[PATCH] D87714: [flang] Fix docs build

Richard Barton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 12:01:41 PDT 2020


richard.barton.arm created this revision.
richard.barton.arm added reviewers: hans, sameeranjoshi.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
richard.barton.arm requested review of this revision.

Apply a local fix to an issue with recommonmark's AutoStructify extension
when used with certain versions of sphinx.

See https://github.com/readthedocs/recommonmark/issues/93


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87714

Files:
  flang/docs/conf.py


Index: flang/docs/conf.py
===================================================================
--- flang/docs/conf.py
+++ flang/docs/conf.py
@@ -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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87714.291995.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200915/f1f3662a/attachment.bin>


More information about the llvm-commits mailing list