Omit NAME section if blank description

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>
This commit is contained in:
Harumi Kuno
2021-09-05 17:42:03 -07:00
parent 26be2d1a77
commit d0e014b4bc
2 changed files with 5 additions and 3 deletions

View File

@@ -2331,6 +2331,8 @@ These options influence manual page output.
*description*
Description of the manual page. This is used in the NAME section.
Can be an empty string if you do not want to automatically generate
the NAME section.
*authors*
A list of strings with authors, or a single string. Can be an empty

View File

@@ -112,10 +112,10 @@ class ManualPageTranslator(SphinxTranslator, BaseTranslator):
# overwritten -- added quotes around all .TH arguments
def header(self) -> str:
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
".SH NAME\n")
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n")
if self._docinfo['subtitle']:
tmpl += "%(title)s \\- %(subtitle)s\n"
tmpl += (".SH NAME\n"
"%(title)s \\- %(subtitle)s\n")
return tmpl % self._docinfo
def visit_start_of_file(self, node: Element) -> None: