Skip to content

Commit

Permalink
manpage: Stop creating a section directory on build manpage by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed May 16, 2021
1 parent 1ab7e28 commit 630e5bd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Incompatible changes
--------------------

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

Deprecated
----------
Expand Down
4 changes: 4 additions & 0 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,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
Expand Down
2 changes: 1 addition & 1 deletion sphinx/builders/manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions tests/test_build_manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
@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

Expand All @@ -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'
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/test_smartquotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

0 comments on commit 630e5bd

Please sign in to comment.