Skip to content

Commit d0e014b

Browse files
committed
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 <[email protected]>
1 parent 26be2d1 commit d0e014b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/usage/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,8 @@ These options influence manual page output.
23312331

23322332
*description*
23332333
Description of the manual page. This is used in the NAME section.
2334+
Can be an empty string if you do not want to automatically generate
2335+
the NAME section.
23342336

23352337
*authors*
23362338
A list of strings with authors, or a single string. Can be an empty

sphinx/writers/manpage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:
112112
# overwritten -- added quotes around all .TH arguments
113113
def header(self) -> str:
114114
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
115-
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
116-
".SH NAME\n")
115+
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n")
117116
if self._docinfo['subtitle']:
118-
tmpl += "%(title)s \\- %(subtitle)s\n"
117+
tmpl += (".SH NAME\n"
118+
"%(title)s \\- %(subtitle)s\n")
119119
return tmpl % self._docinfo
120120

121121
def visit_start_of_file(self, node: Element) -> None:

0 commit comments

Comments
 (0)