Skip to content

Commit 630e5bd

Browse files
committed
manpage: Stop creating a section directory on build manpage by default
1 parent 1ab7e28 commit 630e5bd

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Incompatible changes
88
--------------------
99

1010
* #9222: Update Underscore.js to 1.13.1
11+
* #9217: manpage: Stop creating a section directory on build manpage by default
12+
(see :confval:`man_make_section_directory`)
1113

1214
Deprecated
1315
----------

doc/usage/configuration.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,6 +2339,10 @@ These options influence manual page output.
23392339

23402340
The default is changed to ``False`` from ``True``.
23412341

2342+
.. versionchanged:: 4.0.2
2343+
2344+
The default is changed to ``True`` from ``False`` again.
2345+
23422346
.. _texinfo-options:
23432347

23442348
Options for Texinfo output

sphinx/builders/manpage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
118118

119119
app.add_config_value('man_pages', default_man_pages, None)
120120
app.add_config_value('man_show_urls', False, None)
121-
app.add_config_value('man_make_section_directory', True, None)
121+
app.add_config_value('man_make_section_directory', False, None)
122122

123123
return {
124124
'version': 'builtin',

tests/test_build_manpage.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
@pytest.mark.sphinx('man')
1818
def test_all(app, status, warning):
1919
app.builder.build_all()
20-
assert (app.outdir / '1' / 'sphinxtests.1').exists()
20+
assert (app.outdir / 'sphinxtests.1').exists()
2121

22-
content = (app.outdir / '1' / 'sphinxtests.1').read_text()
22+
content = (app.outdir / 'sphinxtests.1').read_text()
2323
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
2424
assert r'\fBmanpage\en\fP' in content
2525

@@ -31,16 +31,16 @@ def test_all(app, status, warning):
3131

3232

3333
@pytest.mark.sphinx('man', testroot='basic',
34-
confoverrides={'man_make_section_directory': False})
34+
confoverrides={'man_make_section_directory': True})
3535
def test_man_make_section_directory(app, status, warning):
3636
app.build()
37-
assert (app.outdir / 'python.1').exists()
37+
assert (app.outdir / '1' / 'python.1').exists()
3838

3939

4040
@pytest.mark.sphinx('man', testroot='directive-code')
4141
def test_captioned_code_block(app, status, warning):
4242
app.builder.build_all()
43-
content = (app.outdir / '1' / 'python.1').read_text()
43+
content = (app.outdir / 'python.1').read_text()
4444

4545
assert ('.sp\n'
4646
'caption \\fItest\\fP rb\n'
@@ -71,5 +71,5 @@ def test_default_man_pages():
7171
@pytest.mark.sphinx('man', testroot='markup-rubric')
7272
def test_rubric(app, status, warning):
7373
app.build()
74-
content = (app.outdir / '1' / 'python.1').read_text()
74+
content = (app.outdir / 'python.1').read_text()
7575
assert 'This is a rubric\n' in content

tests/test_smartquotes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_text_builder(app, status, warning):
3131
def test_man_builder(app, status, warning):
3232
app.build()
3333

34-
content = (app.outdir / '1' / 'python.1').read_text()
34+
content = (app.outdir / 'python.1').read_text()
3535
assert '\\-\\- "Sphinx" is a tool that makes it easy ...' in content
3636

3737

@@ -84,5 +84,5 @@ def test_smartquotes_excludes_language(app, status, warning):
8484
def test_smartquotes_excludes_builders(app, status, warning):
8585
app.build()
8686

87-
content = (app.outdir / '1' / 'python.1').read_text()
87+
content = (app.outdir / 'python.1').read_text()
8888
assert '– “Sphinx” is a tool that makes it easy …' in content

0 commit comments

Comments
 (0)