diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-17 23:18:00 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-17 23:18:24 +0900 |
commit | 79d9701a005db6aee2edaa330f6339031bb433d8 (patch) | |
tree | 42465d3965691576d5de3c538b613f42cacc38aa | |
parent | d6c19126c5ebd788619d491d4e70c949de9fd2ff (diff) | |
download | sphinx-git-79d9701a005db6aee2edaa330f6339031bb433d8.tar.gz |
Fix #9217: manpage: Dirname of man_make_section_directory is wrong
* Correct: man/man1
* Wrong: man/1
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | sphinx/builders/manpage.py | 5 | ||||
-rw-r--r-- | tests/test_build_manpage.py | 2 |
3 files changed, 6 insertions, 3 deletions
@@ -51,6 +51,8 @@ Bugs fixed * #8597: autodoc: a docsting having metadata only should be treated as undocumented * #9185: autodoc: typehints for overloaded functions and methods are inaccurate +* #9217: manpage: The name of manpage directory that is generated by + :confval:`man_make_section_directory` is not correct Testing -------- diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py index 532d2b8fe..9d8fd5e67 100644 --- a/sphinx/builders/manpage.py +++ b/sphinx/builders/manpage.py @@ -79,8 +79,9 @@ class ManualPageBuilder(Builder): docsettings.section = section if self.config.man_make_section_directory: - ensuredir(path.join(self.outdir, str(section))) - targetname = '%s/%s.%s' % (section, name, section) + dirname = 'man%s' % section + ensuredir(path.join(self.outdir, dirname)) + targetname = '%s/%s.%s' % (dirname, name, section) else: targetname = '%s.%s' % (name, section) diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py index a017abc69..0b7ce2396 100644 --- a/tests/test_build_manpage.py +++ b/tests/test_build_manpage.py @@ -34,7 +34,7 @@ def test_all(app, status, warning): confoverrides={'man_make_section_directory': True}) def test_man_make_section_directory(app, status, warning): app.build() - assert (app.outdir / '1' / 'python.1').exists() + assert (app.outdir / 'man1' / 'python.1').exists() @pytest.mark.sphinx('man', testroot='directive-code') |