-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
let user skip printing command description #9594
Conversation
Don't print the description of a command as a subtitle when generating a manpage if the description is empty. This commit addresses sphinx-doc#9430 Signed-off-by: Harumi Kuno <harumi.kuno@hpe.com>
0da1dbf
to
26be2d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Could you update the document of man_page
? Testcase is also needed for this.
Also, update man page for configuration to document that if a blank description is entered, the "NAME" section is an empty string. Signed-off-by: Harumi Kuno <harumi.kuno@hpe.com>
I'll be happy to do that! Regarding the testcase, do you mean add a new testcase to test_build_manpage.py? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I added a testcase directly.
Merged. Thank you for your contribution! |
Subject: let user skip printing command description
Update manpage builder to skip printing the description of a command as a subtitle if the supplied description is blank.
This commit addresses #9430
Feature or Bugfix
Purpose
Many well-established software library projects that predate RST have a large number of existing *roff-style man pages.
Such projects often have both online documentation on the web and also man pages for use on linux operating systems.
When such packages choose to switch their man pages from nroff to RST, they may want to use a single set of RST files as source to produce both their online documentation (html files) and also their linux man pages (nroff files).
However, the manpage.py builder currently always adds a subtitle with a description of the command that is provided as input to config and the html builders do not do this.
This means that the RST author currently has to produce different RST source files for the manpage and the html builders,
because if the RST file contains a description of the command then that description will appear twice in the generated man page, and if the RST file does NOT contain a description of the command, then there will be no description in the generated html file.
For example, @jsquyres and I would like to generate both groff files and also html files from a single set of rst man page files for the Open-MPI project (https://github.com/open-mpi/). Here is a simple example: https://github.com/jsquyres/ompi-sphinx-dist/blob/main/docs/src/ompi-man/man3/MPI_Abort.3.rst . Some examples of the original nroff files are here: https://github.com/open-mpi/ompi/tree/master/ompi/mpi/man/man3
If rst/conf.py contains the following:
... then the generated man page will look like this:
If we omit the "MPI_Abort - Terminates MPI execution environment." line from the RST file, then the generated html page will lose that command description.
This PR would make it possible for us to use sphinx-build to produce both HTML and manpage files from a single set of RST files.
Detail
Relates