[flang-commits] [flang] af56be3 - [flang] Fix docs build

Richard Barton via flang-commits flang-commits at lists.llvm.org
Wed Sep 16 00:19:19 PDT 2020


Author: Richard Barton
Date: 2020-09-16T08:19:07+01:00
New Revision: af56be339f8c9660747794cc6755384154602535

URL: https://github.com/llvm/llvm-project/commit/af56be339f8c9660747794cc6755384154602535
DIFF: https://github.com/llvm/llvm-project/commit/af56be339f8c9660747794cc6755384154602535.diff

LOG: [flang] Fix docs build

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

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D87714

Added: 
    

Modified: 
    flang/docs/conf.py

Removed: 
    


################################################################################
diff  --git a/flang/docs/conf.py b/flang/docs/conf.py
index 851b233767a9..197721a4e4c8 100644
--- a/flang/docs/conf.py
+++ b/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


        


More information about the flang-commits mailing list