a-recknagel / stenotype

Support for shorthand type annotations.
MIT License
3 stars 2 forks source link

[Bug]: The CLI docs look ugly #25

Open a-recknagel opened 5 years ago

a-recknagel commented 5 years ago

The docstring rendering that sphinx-click does look horrible (see https://a-recknagel.github.io/stenotype/cli.html#stenotype for source):

Screenshot from 2019-10-08 15-17-14

Reasons for that is that it is also used to make stenotype --help look good:

$ stenotype --help
Usage: stenotype [OPTIONS] [ARGS]...

  CLI entrypoint to test the stenotype backend.

  Enter any number of stenotype expressions to see which standard
  annotations they will resolve into. There is no need to double quote
  expression or to assign them to a value, the following will just work:

    $ stenotype 'bool or int'
    typing.Union[bool, int]
    $ stenotype '(int) -> bool'
    typing.Signature[[int], bool]

  You can also enter multiple arguments that will be executed in turn and
  consider each other in the context of, for example, custom type variables:

    $ stenotype 'T, int' 'bool or T'
    T = TypeVar[int]
    typing.Union[bool, T]

...

It would be nice to make it look good in both views while still using autodocs to generate the sphinx one.