mirror of
https://github.com/vale981/releases
synced 2025-03-05 09:41:42 -05:00
Welp, turns out this was crucial to correctly rendered doctrees.
Only impacts use of get_doctree(), aka invocations.release tasks. Fixes #72
This commit is contained in:
parent
d5f397fe2c
commit
f611196bc4
1 changed files with 26 additions and 21 deletions
|
@ -13,7 +13,7 @@ from docutils.nodes import bullet_list
|
|||
from sphinx.application import Sphinx # not exposed at top level
|
||||
# NOTE: importing these from environment for backwards compat with Sphinx 1.3
|
||||
from sphinx.environment import (
|
||||
SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter,
|
||||
SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, sphinx_domains,
|
||||
)
|
||||
|
||||
from . import construct_releases, setup
|
||||
|
@ -132,9 +132,14 @@ def get_doctree(path):
|
|||
reader_kwargs = {
|
||||
'app': app,
|
||||
'parsers': env.config.source_parsers,
|
||||
#'parsers': app.registry.get_source_parsers()
|
||||
}
|
||||
if sphinx.version_info[:2] < (1, 4):
|
||||
del reader_kwargs['app']
|
||||
# This monkeypatches (!!!) docutils to 'inject' all registered Sphinx
|
||||
# domains' roles & so forth. Without this, rendering the doctree lacks
|
||||
# almost all Sphinx magic, including things like :ref: and :doc:!
|
||||
with sphinx_domains(env):
|
||||
reader = SphinxStandaloneReader(**reader_kwargs)
|
||||
pub = Publisher(reader=reader,
|
||||
writer=SphinxDummyWriter(),
|
||||
|
|
Loading…
Add table
Reference in a new issue