summaryrefslogtreecommitdiff
path: root/sphinx/builders/manpage.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-04 22:41:44 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-04 22:41:44 +0900
commit598b85da75bc533004d68b95a5056016dc16df1c (patch)
treee08eae0ea5f098257f01081e4c792bcfeb92eba6 /sphinx/builders/manpage.py
parent11633f2e53bf01f6844256558444991836815690 (diff)
parent38bb3774643d779b708970f941f2b16d1ab81b89 (diff)
downloadsphinx-git-598b85da75bc533004d68b95a5056016dc16df1c.tar.gz
Merge branch '3.x' into master
Diffstat (limited to 'sphinx/builders/manpage.py')
-rw-r--r--sphinx/builders/manpage.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py
index 4166dece9..2a10ba62f 100644
--- a/sphinx/builders/manpage.py
+++ b/sphinx/builders/manpage.py
@@ -24,7 +24,7 @@ from sphinx.util import logging
from sphinx.util import progress_message
from sphinx.util.console import darkgreen # type: ignore
from sphinx.util.nodes import inline_all_toctrees
-from sphinx.util.osutil import make_filename_from_project
+from sphinx.util.osutil import ensuredir, make_filename_from_project
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
@@ -80,7 +80,12 @@ class ManualPageBuilder(Builder):
docsettings.authors = authors
docsettings.section = section
- targetname = '%s.%s' % (name, section)
+ if self.config.man_make_section_directory:
+ ensuredir(path.join(self.outdir, str(section)))
+ targetname = '%s/%s.%s' % (section, name, section)
+ else:
+ targetname = '%s.%s' % (name, section)
+
logger.info(darkgreen(targetname) + ' { ', nonl=True)
destination = FileOutput(
destination_path=path.join(self.outdir, targetname),
@@ -115,6 +120,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.add_config_value('man_pages', default_man_pages, None)
app.add_config_value('man_show_urls', False, None)
+ app.add_config_value('man_make_section_directory', False, None)
return {
'version': 'builtin',