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

Sphinxify the command line documentation #252

Closed
latk opened this Issue Apr 13, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@latk
Member

latk commented Apr 13, 2018

Currently, the command line docs are rendered in the guide by piping the gcovr --help output into a file, and including it as a literal block. This works … but is ugly, hard to read, and cannot be used to link to a specific option.

Can we use some Sphinx features to improve this documentation, without having to duplicate the command line docs?

Of course, there are already Sphinx plugins that might be helpful:

sphinxcontrib.autoprogram renders the command line parameters nicely. However, it lumps all argument groups together which hides valuable context and makes the long list of options more difficult to read.

sphinx-argparse does render argument groups correctly, but uses tables for layout instead of the correct Sphinx roles. These tables overflow and have to be scrolled horizontally. Also, option value placeholders (metavars) are not rendered, which makes the phrasing of some option help messages difficult to read.

Due to these problems, neither of those plugins is currently a good replacement for the CLI documentation.

Help wanted:

  • Are there any other alternatives that do not suffer from these problems?

  • If no alternative exists, could the existing modules be extended to address these issues? E.g. I believe it would be possible to add subgroup support to autoprogram since it already supports subparsers.

@latk

This comment has been minimized.

Member

latk commented Apr 16, 2018

I have implemented group support for autoprogram. The PR is currently awaiting review at sphinx-contrib/autoprogram#3. Once that is released, switching from gcovr --help to autoprogram is a very easy change, but makes our docs so much more legible.

@latk latk self-assigned this Apr 16, 2018

latk added a commit to latk/gcovr that referenced this issue May 19, 2018

docs: sphinxcontrib-autoprogram for pretty CLI docs
This replaces the `gcovr --help` output with more readable (and
linkable!) documentation using autoprogram. This derives derives the
documentation neatly from the argparse help messages.

closes gcovr#252

@latk latk closed this in b605fe4 May 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment