mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8284 from tk0miya/7996_man_make_section_directory_by_default
Close #7996: manpage: Make a section directory on build manpage by default
This commit is contained in:
commit
7eabbfc5ec
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Incompatible changes
|
|||||||
MathJax configuration may have to set the old MathJax path or update their
|
MathJax configuration may have to set the old MathJax path or update their
|
||||||
configuration for version 3. See :mod:`sphinx.ext.mathjax`.
|
configuration for version 3. See :mod:`sphinx.ext.mathjax`.
|
||||||
* #7784: i18n: The msgid for alt text of image is changed
|
* #7784: i18n: The msgid for alt text of image is changed
|
||||||
|
* #7996: manpage: Make a section directory on build manpage by default (see
|
||||||
|
:confval:`man_make_section_directory`)
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
@ -2253,10 +2253,12 @@ These options influence manual page output.
|
|||||||
|
|
||||||
.. confval:: man_make_section_directory
|
.. confval:: man_make_section_directory
|
||||||
|
|
||||||
If true, make a section directory on build man page. Default is False.
|
If true, make a section directory on build man page. Default is True.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
.. versionchanged:: 4.0
|
||||||
|
|
||||||
|
The default is changed to ``False`` from ``True``.
|
||||||
|
|
||||||
.. _texinfo-options:
|
.. _texinfo-options:
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
|
|||||||
|
|
||||||
app.add_config_value('man_pages', default_man_pages, None)
|
app.add_config_value('man_pages', default_man_pages, None)
|
||||||
app.add_config_value('man_show_urls', False, None)
|
app.add_config_value('man_show_urls', False, None)
|
||||||
app.add_config_value('man_make_section_directory', False, None)
|
app.add_config_value('man_make_section_directory', True, None)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'version': 'builtin',
|
'version': 'builtin',
|
||||||
|
@ -17,9 +17,9 @@ from sphinx.config import Config
|
|||||||
@pytest.mark.sphinx('man')
|
@pytest.mark.sphinx('man')
|
||||||
def test_all(app, status, warning):
|
def test_all(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
assert (app.outdir / 'sphinxtests.1').exists()
|
assert (app.outdir / '1' / 'sphinxtests.1').exists()
|
||||||
|
|
||||||
content = (app.outdir / 'sphinxtests.1').read_text()
|
content = (app.outdir / '1' / 'sphinxtests.1').read_text()
|
||||||
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
|
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
|
||||||
assert r'\fBmanpage\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',
|
@pytest.mark.sphinx('man', testroot='basic',
|
||||||
confoverrides={'man_make_section_directory': True})
|
confoverrides={'man_make_section_directory': False})
|
||||||
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 / 'python.1').exists()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('man', testroot='directive-code')
|
@pytest.mark.sphinx('man', testroot='directive-code')
|
||||||
def test_captioned_code_block(app, status, warning):
|
def test_captioned_code_block(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
content = (app.outdir / 'python.1').read_text()
|
content = (app.outdir / '1' / 'python.1').read_text()
|
||||||
|
|
||||||
assert ('.sp\n'
|
assert ('.sp\n'
|
||||||
'caption \\fItest\\fP rb\n'
|
'caption \\fItest\\fP rb\n'
|
||||||
@ -71,5 +71,5 @@ def test_default_man_pages():
|
|||||||
@pytest.mark.sphinx('man', testroot='markup-rubric')
|
@pytest.mark.sphinx('man', testroot='markup-rubric')
|
||||||
def test_rubric(app, status, warning):
|
def test_rubric(app, status, warning):
|
||||||
app.build()
|
app.build()
|
||||||
content = (app.outdir / 'python.1').read_text()
|
content = (app.outdir / '1' / 'python.1').read_text()
|
||||||
assert 'This is a rubric\n' in content
|
assert 'This is a rubric\n' in content
|
||||||
|
@ -31,7 +31,7 @@ def test_text_builder(app, status, warning):
|
|||||||
def test_man_builder(app, status, warning):
|
def test_man_builder(app, status, warning):
|
||||||
app.build()
|
app.build()
|
||||||
|
|
||||||
content = (app.outdir / 'python.1').read_text()
|
content = (app.outdir / '1' / 'python.1').read_text()
|
||||||
assert '\\-\\- "Sphinx" is a tool that makes it easy ...' in content
|
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):
|
def test_smartquotes_excludes_builders(app, status, warning):
|
||||||
app.build()
|
app.build()
|
||||||
|
|
||||||
content = (app.outdir / 'python.1').read_text()
|
content = (app.outdir / '1' / 'python.1').read_text()
|
||||||
assert '– “Sphinx” is a tool that makes it easy …' in content
|
assert '– “Sphinx” is a tool that makes it easy …' in content
|
||||||
|
Loading…
Reference in New Issue
Block a user