Skip to content

Commit b686e54

Browse files
RichBarton-Armarichardson
authored andcommitted
[flang] Fix docs build
Apply a local fix to an issue with recommonmark's AutoStructify extension when used with certain versions of sphinx. See readthedocs/recommonmark#93 Reviewed By: hans Differential Revision: https://reviews.llvm.org/D87714
2 parents 322369b + af56be3 commit b686e54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

flang/docs/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050

5151
# Setup AutoStructify for inline .rst toctrees in index.md
5252
from recommonmark.transform import AutoStructify
53+
54+
# Stolen from https://github.com/readthedocs/recommonmark/issues/93
55+
# Monkey patch to fix recommonmark 0.4 doc reference issues.
56+
from recommonmark.states import DummyStateMachine
57+
orig_run_role = DummyStateMachine.run_role
58+
def run_role(self, name, options=None, content=None):
59+
if name == 'doc':
60+
name = 'any'
61+
return orig_run_role(self, name, options, content)
62+
DummyStateMachine.run_role = run_role
63+
5364
def setup(app):
5465
# Disable inline math to avoid
5566
# https://github.com/readthedocs/recommonmark/issues/120 in Extensions.md

0 commit comments

Comments
 (0)