diff options
author | Harumi Kuno <harumi.kuno@hpe.com> | 2021-08-30 11:43:06 +0300 |
---|---|---|
committer | Harumi Kuno <harumi.kuno@hpe.com> | 2021-08-30 18:33:19 +0300 |
commit | 26be2d1a77fdf404b9061bc6f4a2e25d7e4cbab0 (patch) | |
tree | 36131fe5f119ea556433f6fc5d3f9d66a0ad4815 /sphinx/writers | |
parent | 9ed054279aeffd5b1d0642e2d24a8800389de29f (diff) |
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 sphinx-doc#9430
Signed-off-by: Harumi Kuno <harumi.kuno@hpe.com>
Diffstat (limited to 'sphinx/writers')
-rw-r--r-- | sphinx/writers/manpage.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py index 90f3accbf..29d93aa84 100644 --- a/sphinx/writers/manpage.py +++ b/sphinx/writers/manpage.py @@ -113,8 +113,9 @@ class ManualPageTranslator(SphinxTranslator, BaseTranslator): 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: |