diff options
author | cor3ntin <corentinjabot@gmail.com> | 2024-03-04 13:31:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 13:31:26 +0100 |
commit | 7d55a3ba92368be55b392c20d623fde6ac82d86d (patch) | |
tree | bc461be9c21bd77d653316fac07cb0add220ed6b /llvm/docs/conf.py | |
parent | 00e4a4197137410129d4725ffb82bae9ce44bdde (diff) | |
download | llvm-7d55a3ba92368be55b392c20d623fde6ac82d86d.zip llvm-7d55a3ba92368be55b392c20d623fde6ac82d86d.tar.gz llvm-7d55a3ba92368be55b392c20d623fde6ac82d86d.tar.bz2 |
[Docs] Allow building man pages without myst_parser (#82402)
The man pages do not depend on the doc present in markdown files, so
they can be built without myst_parser.
Doing so might allow llvm distributions to have less development
dependencies.
As we do not have the ennvironment to test these configuration, this
capability is provided on a best-effort basis.
This restores a capability accidentally lost in #65664.
Diffstat (limited to 'llvm/docs/conf.py')
-rw-r--r-- | llvm/docs/conf.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py index 0a39052..acbddc7 100644 --- a/llvm/docs/conf.py +++ b/llvm/docs/conf.py @@ -26,7 +26,18 @@ sys.path.insert(0, os.path.abspath(".")) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["myst_parser", "sphinx.ext.intersphinx", "sphinx.ext.todo"] +extensions = ["sphinx.ext.intersphinx", "sphinx.ext.todo"] + +# 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 # Automatic anchors for markdown titles from llvm_slug import make_slug |