Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Man pages ignore \b characters in docstrings #9

Open
gtristan opened this issue May 27, 2017 · 0 comments
Open

Man pages ignore \b characters in docstrings #9

gtristan opened this issue May 27, 2017 · 0 comments

Comments

@gtristan
Copy link

gtristan commented May 27, 2017

As is documented in click here, the docstrings for click commands are expected to contain \b characters before a paragraph which should not be made to wrap.

This allows better formatting of docstrings in the help output, without this it is impossible to make any kind of formatting of the help such as point form lists which describe the meaning of each click.Choice() option.

This works well for click's help output, but is also broken for the sphinx-click generated html docs, and for sphinx-man generated man pages.

Here are two examples to show the brokenness:

Broken man page output

NAME
       bst-show - Show elements in the pipeline

SYNOPSIS
       bst show [OPTIONS] TARGET

DESCRIPTION
       Show elements in the pipeline

       By default this will only show the specified element, use the --deps option to show an entire pipeline.

       FORMAT ~~~~~~ The --format option controls what should be printed for each element, the following symbols can be used in the format string:

           %{name}     The element name
           %{key}      The abbreviated cache key (if all sources are consistent)
           %{full-key} The full cache key (if all sources are consistent)
           %{state}    cached, buildable, waiting or inconsistent
           %{config}   The element configuration
           %{vars}     Variable configuration
           %{env}      Environment settings
           %{public}   Public domain data

       The value of the %{symbol} without the leading '%' character is understood as a pythonic formatting string, so python formatting features apply, examle:

           build-stream show target.bst --format         'Name: %{name: ^20} Key: %{key: ^8} State: %{state}'

       If you want to use a newline in a format string in bash, use the '$' modifier:

           build-stream show target.bst --format         $'---------- %{name} ----------1{vars}'

OPTIONS
       -d, --deps [all|build|run]
              Optionally specify a dependency scope to show

       --order [stage|alpha]
              Staging or alphabetic ordering of dependencies

       -f, --format FORMAT
              Format string for each element

       -a, --arch TEXT
              The target architecture (default: x86_64)

       --variant TEXT
              A variant of the specified target

                                                                                              09-May-2017                                                                                  BST SHOW(1)

Well formatted output of bst show --help

Usage: bst show [OPTIONS] TARGET

  Show elements in the pipeline

  By default this will only show the specified element, use the --deps
  option to show an entire pipeline.

  FORMAT
  ~~~~~~
  The --format option controls what should be printed for each element,
  the following symbols can be used in the format string:

      %{name}     The element name
      %{key}      The abbreviated cache key (if all sources are consistent)
      %{full-key} The full cache key (if all sources are consistent)
      %{state}    cached, buildable, waiting or inconsistent
      %{config}   The element configuration
      %{vars}     Variable configuration
      %{env}      Environment settings
      %{public}   Public domain data

  The value of the %{symbol} without the leading '%' character is understood
  as a pythonic formatting string, so python formatting features apply,
  examle:

      build-stream show target.bst --format \
          'Name: %{name: ^20} Key: %{key: ^8} State: %{state}'

  If you want to use a newline in a format string in bash, use the '$'
  modifier:

      build-stream show target.bst --format \
          $'---------- %{name} ----------\n%{vars}'

Options:
  -d, --deps [all|build|run]  Optionally specify a dependency scope to show
  --order [stage|alpha]       Staging or alphabetic ordering of dependencies
  -f, --format FORMAT         Format string for each element
  -a, --arch TEXT             The target architecture (default: x86_64)
  --variant TEXT              A variant of the specified target
  --help                      Show this message and exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant