Author: David Spickett
Date: 2026-06-02T16:01:18+01:00
New Revision: 87b97d67d401938086edc0602f55fe284bffc24d

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

LOG: [clang-tools-extra][docs] Do not require myst_parser when building man 
pages (#201138)

Added: 
    

Modified: 
    clang-tools-extra/docs/conf.py

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/docs/conf.py b/clang-tools-extra/docs/conf.py
index b0174894c4e4a..8247cd173fcf6 100644
--- a/clang-tools-extra/docs/conf.py
+++ b/clang-tools-extra/docs/conf.py
@@ -13,7 +13,6 @@
 
 import sys, os
 from datetime import date
-import myst_parser
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -27,7 +26,18 @@
 
 # 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.todo", "sphinx.ext.mathjax", "myst_parser"]
+extensions = ["sphinx.ext.todo", "sphinx.ext.mathjax"]
+
+# When building man pages, we do not use the markdown pages,
+# So, we can continue without the myst_parser dependencies.
+# Doing so reduces dependencies of some packaged llvm distributions.
+try:
+    import myst_parser
+
+    extensions.append("myst_parser")
+except ImportError:
+    if not tags.has("builder-man"):
+        raise
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to