2013-07-27 00:13:15 -05:00
|
|
|
"""Test docutils.conf support for several writers."""
|
|
|
|
|
2017-01-05 10:14:47 -06:00
|
|
|
import pytest
|
2019-02-08 09:36:25 -06:00
|
|
|
from docutils import nodes
|
2018-02-19 07:39:14 -06:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
from sphinx.testing.util import assert_node
|
2018-03-29 08:45:20 -05:00
|
|
|
from sphinx.util.docutils import patch_docutils
|
2013-07-27 00:13:15 -05:00
|
|
|
|
|
|
|
|
2019-02-08 23:44:37 -06:00
|
|
|
@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True)
|
2024-07-23 09:35:55 -05:00
|
|
|
def test_html_with_default_docutilsconf(app):
|
2018-03-29 08:45:20 -05:00
|
|
|
with patch_docutils(app.confdir):
|
2019-02-08 09:36:25 -06:00
|
|
|
app.build()
|
2018-03-29 08:45:20 -05:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
doctree = app.env.get_doctree('index')
|
|
|
|
assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx ",
|
|
|
|
[nodes.footnote_reference, "1"])])
|
2013-07-27 00:13:15 -05:00
|
|
|
|
|
|
|
|
2019-02-08 23:44:37 -06:00
|
|
|
@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True,
|
2024-01-16 20:38:46 -06:00
|
|
|
docutils_conf=('[restructuredtext parser]\n'
|
|
|
|
'trim_footnote_reference_space: true\n'))
|
2024-07-23 09:35:55 -05:00
|
|
|
def test_html_with_docutilsconf(app):
|
2018-03-29 08:45:20 -05:00
|
|
|
with patch_docutils(app.confdir):
|
2019-02-08 09:36:25 -06:00
|
|
|
app.build()
|
2013-07-27 00:13:15 -05:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
doctree = app.env.get_doctree('index')
|
|
|
|
assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx",
|
|
|
|
[nodes.footnote_reference, "1"])])
|