summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-05-16 17:02:41 +0900
committerGitHub <noreply@github.com>2021-05-16 17:02:41 +0900
commit8d87dde43ba0400c46d791e42d9b50bc879cdddb (patch)
tree4cbd1bdfd55af02d1b20752c7e06cae05c808fe0
parent576d0b98a410aea5f7cb0da98eea4aabf6111269 (diff)
parentfa8117cd2fbdde7eb0f3f80251be412d5b4191f8 (diff)
downloadsphinx-git-8d87dde43ba0400c46d791e42d9b50bc879cdddb.tar.gz
Merge pull request #9232 from tk0miya/9217_dont_make_section_directory
manpage: Stop creating a section directory on build manpage by default
-rw-r--r--CHANGES3
-rw-r--r--doc/usage/configuration.rst4
-rw-r--r--sphinx/builders/manpage.py2
-rw-r--r--tests/test_build_manpage.py12
-rw-r--r--tests/test_smartquotes.py4
5 files changed, 16 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index 36caf8f77..c4edcb8af 100644
--- a/CHANGES
+++ b/CHANGES
@@ -62,6 +62,9 @@ Dependencies
Incompatible changes
--------------------
+* #9217: manpage: Stop creating a section directory on build manpage by default
+ (see :confval:`man_make_section_directory`)
+
Deprecated
----------
diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst
index 0b2bd4e3e..ddd3c930e 100644
--- a/doc/usage/configuration.rst
+++ b/doc/usage/configuration.rst
@@ -2357,6 +2357,10 @@ These options influence manual page output.
The default is changed to ``False`` from ``True``.
+ .. versionchanged:: 4.0.2
+
+ The default is changed to ``True`` from ``False`` again.
+
.. _texinfo-options:
Options for Texinfo output
diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py
index b993a2df4..532d2b8fe 100644
--- a/sphinx/builders/manpage.py
+++ b/sphinx/builders/manpage.py
@@ -118,7 +118,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', True, None)
+ app.add_config_value('man_make_section_directory', False, None)
return {
'version': 'builtin',
diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py
index 2affb8ba3..a017abc69 100644
--- a/tests/test_build_manpage.py
+++ b/tests/test_build_manpage.py
@@ -17,9 +17,9 @@ from sphinx.config import Config
@pytest.mark.sphinx('man')
def test_all(app, status, warning):
app.builder.build_all()
- assert (app.outdir / '1' / 'sphinxtests.1').exists()
+ assert (app.outdir / 'sphinxtests.1').exists()
- content = (app.outdir / '1' / 'sphinxtests.1').read_text()
+ content = (app.outdir / 'sphinxtests.1').read_text()
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
assert r'\fBmanpage\en\fP' in content
@@ -31,16 +31,16 @@ def test_all(app, status, warning):
@pytest.mark.sphinx('man', testroot='basic',
- confoverrides={'man_make_section_directory': False})
+ confoverrides={'man_make_section_directory': True})
def test_man_make_section_directory(app, status, warning):
app.build()
- assert (app.outdir / 'python.1').exists()
+ assert (app.outdir / '1' / 'python.1').exists()
@pytest.mark.sphinx('man', testroot='directive-code')
def test_captioned_code_block(app, status, warning):
app.builder.build_all()
- content = (app.outdir / '1' / 'python.1').read_text()
+ content = (app.outdir / 'python.1').read_text()
assert ('.sp\n'
'caption \\fItest\\fP rb\n'
@@ -71,5 +71,5 @@ def test_default_man_pages():
@pytest.mark.sphinx('man', testroot='markup-rubric')
def test_rubric(app, status, warning):
app.build()
- content = (app.outdir / '1' / 'python.1').read_text()
+ content = (app.outdir / 'python.1').read_text()
assert 'This is a rubric\n' in content
diff --git a/tests/test_smartquotes.py b/tests/test_smartquotes.py
index a8d4b1ed6..4879dedc6 100644
--- a/tests/test_smartquotes.py
+++ b/tests/test_smartquotes.py
@@ -31,7 +31,7 @@ def test_text_builder(app, status, warning):
def test_man_builder(app, status, warning):
app.build()
- content = (app.outdir / '1' / 'python.1').read_text()
+ content = (app.outdir / 'python.1').read_text()
assert '\\-\\- "Sphinx" is a tool that makes it easy ...' in content
@@ -84,5 +84,5 @@ def test_smartquotes_excludes_language(app, status, warning):
def test_smartquotes_excludes_builders(app, status, warning):
app.build()
- content = (app.outdir / '1' / 'python.1').read_text()
+ content = (app.outdir / 'python.1').read_text()
assert '– “Sphinx” is a tool that makes it easy …' in content