Skip to content

Commit

Permalink
skip empty description
Browse files Browse the repository at this point in the history
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 <harumi.kuno@hpe.com>
  • Loading branch information
hkuno committed Aug 30, 2021
1 parent 9ed0542 commit 26be2d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sphinx/writers/manpage.py
Expand Up @@ -113,8 +113,9 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:
def header(self) -> str:
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
".SH NAME\n"
"%(title)s \\- %(subtitle)s\n")
".SH NAME\n")
if self._docinfo['subtitle']:
tmpl += "%(title)s \\- %(subtitle)s\n"
return tmpl % self._docinfo

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

0 comments on commit 26be2d1

Please sign in to comment.