[PATCH] D75284: [Sphinx] Adjust for source_parsers deprecation in Sphinx 3.0

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 15:12:22 PDT 2020


JDevlieghere updated this revision to Diff 273843.
JDevlieghere added a comment.

Make the change conditional on the Sphinx version.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75284/new/

https://reviews.llvm.org/D75284

Files:
  llvm/docs/conf.py


Index: llvm/docs/conf.py
===================================================================
--- llvm/docs/conf.py
+++ llvm/docs/conf.py
@@ -26,7 +26,14 @@
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo', 'recommonmark']
+extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo']
+
+import sphinx
+if sphinx.version_info >= (3, 0):
+  # This requires 0.5 or later.
+  extensions.append('recommonmark')
+else:
+  source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'}
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75284.273843.patch
Type: text/x-patch
Size: 748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200626/55a74dc4/attachment.bin>


More information about the llvm-commits mailing list