From 76b39656482a184177e8313ca1f04e7cabb5052c Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 20 Apr 2023 22:17:08 +0200 Subject: [PATCH] docs/string: Separate "pad" and "shorten" This isn't the same as "join"/"join0", where one is just a special case of the other. These are two different, if basically opposite commands. But more importantly this was a huge mess and the formatting was broken. --- doc_src/cmds/string-pad.rst | 6 +++--- doc_src/cmds/string-shorten.rst | 6 ++++-- doc_src/cmds/string.rst | 25 +++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/doc_src/cmds/string-pad.rst b/doc_src/cmds/string-pad.rst index d9f707eed..5a255d487 100644 --- a/doc_src/cmds/string-pad.rst +++ b/doc_src/cmds/string-pad.rst @@ -48,13 +48,13 @@ Examples >_ string pad -w$COLUMNS (date) # Prints the current time on the right edge of the screen. - +.. END EXAMPLES See Also -------- +.. BEGIN SEEALSO + - The :doc:`printf ` command can do simple padding, for example ``printf %10s\n`` works like ``string pad -w10``. - :doc:`string length ` with the ``--visible`` option can be used to show what fish thinks the width is. - -.. END EXAMPLES diff --git a/doc_src/cmds/string-shorten.rst b/doc_src/cmds/string-shorten.rst index ebb402deb..fe5700f7e 100644 --- a/doc_src/cmds/string-shorten.rst +++ b/doc_src/cmds/string-shorten.rst @@ -81,13 +81,15 @@ Examples # Taking 20 columns from the right instead: …in-path-with-expand +.. END EXAMPLES + See Also -------- +.. BEGIN SEEALSO + - :ref:`string`'s ``pad`` subcommand does the inverse of this command, adding padding to a specific width instead. - The :doc:`printf ` command can do simple padding, for example ``printf %10s\n`` works like ``string pad -w10``. - :doc:`string length ` with the ``--visible`` option can be used to show what fish thinks the width is. - -.. END EXAMPLES diff --git a/doc_src/cmds/string.rst b/doc_src/cmds/string.rst index 65692643c..621e8e083 100644 --- a/doc_src/cmds/string.rst +++ b/doc_src/cmds/string.rst @@ -154,8 +154,8 @@ Examples :start-after: BEGIN EXAMPLES :end-before: END EXAMPLES -"pad" and "shorten" subcommands ---------------------------------- +"pad" subcommand +---------------- .. include:: string-pad.rst :start-after: BEGIN SYNOPSIS @@ -165,10 +165,22 @@ Examples :start-after: BEGIN DESCRIPTION :end-before: END DESCRIPTION +Examples +^^^^^^^^ + .. include:: string-pad.rst :start-after: BEGIN EXAMPLES :end-before: END EXAMPLES +See also +^^^^^^^^ + +.. include:: string-pad.rst + :start-after: BEGIN SEEALSO + +"shorten" subcommand +-------------------- + .. include:: string-shorten.rst :start-after: BEGIN SYNOPSIS :end-before: END SYNOPSIS @@ -177,10 +189,19 @@ Examples :start-after: BEGIN DESCRIPTION :end-before: END DESCRIPTION +Examples +^^^^^^^^ + .. include:: string-shorten.rst :start-after: BEGIN EXAMPLES :end-before: END EXAMPLES +See also +^^^^^^^^ + +.. include:: string-shorten.rst + :start-after: BEGIN SEEALSO + "repeat" subcommand -------------------