mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Override the current-directory local "docutils.conf" location with the Sphinx srcdir.
This commit is contained in:
parent
db1cf80a69
commit
0511ced21a
@ -33,6 +33,7 @@ from docutils.parsers.rst import roles, directives
|
||||
from docutils.parsers.rst.languages import en as english
|
||||
from docutils.parsers.rst.directives.html import MetaBody
|
||||
from docutils.writers import UnfilteredWriter
|
||||
from docutils.frontend import OptionParser
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.util import url_re, get_matching_docs, docname_join, split_into, \
|
||||
@ -582,6 +583,12 @@ class BuildEnvironment:
|
||||
|
||||
self.patch_lookup_functions()
|
||||
|
||||
docutilsconf = path.join(self.srcdir, 'docutils.conf')
|
||||
# read docutils.conf from source dir, not from current dir
|
||||
OptionParser.standard_config_files[1] = docutilsconf
|
||||
if path.isfile(docutilsconf):
|
||||
self.note_dependency(docutilsconf)
|
||||
|
||||
if self.config.default_role:
|
||||
role_fn, messages = roles.role(self.config.default_role, english,
|
||||
0, dummy_reporter)
|
||||
|
Loading…
Reference in New Issue
Block a user