Merge pull request #9231 from tk0miya/9217_manpage_section_directory

Fix #9217: manpage: Dirname of man_make_section_directory is wrong
This commit is contained in:
Takeshi KOMIYA 2021-05-19 23:00:03 +09:00 committed by GitHub
commit 567ff22716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -51,6 +51,8 @@ Bugs fixed
* #8597: autodoc: a docsting having metadata only should be treated as * #8597: autodoc: a docsting having metadata only should be treated as
undocumented undocumented
* #9185: autodoc: typehints for overloaded functions and methods are inaccurate * #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 Testing
-------- --------

View File

@ -79,8 +79,9 @@ class ManualPageBuilder(Builder):
docsettings.section = section docsettings.section = section
if self.config.man_make_section_directory: if self.config.man_make_section_directory:
ensuredir(path.join(self.outdir, str(section))) dirname = 'man%s' % section
targetname = '%s/%s.%s' % (section, name, section) ensuredir(path.join(self.outdir, dirname))
targetname = '%s/%s.%s' % (dirname, name, section)
else: else:
targetname = '%s.%s' % (name, section) targetname = '%s.%s' % (name, section)

View File

@ -34,7 +34,7 @@ def test_all(app, status, warning):
confoverrides={'man_make_section_directory': True}) confoverrides={'man_make_section_directory': True})
def test_man_make_section_directory(app, status, warning): def test_man_make_section_directory(app, status, warning):
app.build() app.build()
assert (app.outdir / '1' / 'python.1').exists() assert (app.outdir / 'man1' / 'python.1').exists()
@pytest.mark.sphinx('man', testroot='directive-code') @pytest.mark.sphinx('man', testroot='directive-code')