Skip to content

Commit 26be2d1

Browse files
committed
skip empty description
Don't print the description of a command as a subtitle when generating a manpage if the description is empty. This commit addresses #9430 Signed-off-by: Harumi Kuno <[email protected]>
1 parent 9ed0542 commit 26be2d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sphinx/writers/manpage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:
113113
def header(self) -> str:
114114
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
115115
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
116-
".SH NAME\n"
117-
"%(title)s \\- %(subtitle)s\n")
116+
".SH NAME\n")
117+
if self._docinfo['subtitle']:
118+
tmpl += "%(title)s \\- %(subtitle)s\n"
118119
return tmpl % self._docinfo
119120

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

0 commit comments

Comments
 (0)