Skip to content

Commit

Permalink
[flang] Fix docs build
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RichBarton-Arm authored and arichardson committed Mar 23, 2021
2 parents 322369b + af56be3 commit b686e54
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions flang/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@

# Setup AutoStructify for inline .rst toctrees in index.md
from recommonmark.transform import AutoStructify

# Stolen from https://github.com/readthedocs/recommonmark/issues/93
# Monkey patch to fix recommonmark 0.4 doc reference issues.
from recommonmark.states import DummyStateMachine
orig_run_role = DummyStateMachine.run_role
def run_role(self, name, options=None, content=None):
if name == 'doc':
name = 'any'
return orig_run_role(self, name, options, content)
DummyStateMachine.run_role = run_role

def setup(app):
# Disable inline math to avoid
# https://github.com/readthedocs/recommonmark/issues/120 in Extensions.md
Expand Down

0 comments on commit b686e54

Please sign in to comment.