|
13 | 13 | import sys, os, re, shutil
|
14 | 14 | from datetime import date
|
15 | 15 |
|
| 16 | +# Add path for llvm_slug module. |
| 17 | +sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "llvm", "docs"))) |
| 18 | + |
16 | 19 | building_man_page = tags.has("builder-man")
|
17 | 20 |
|
18 | 21 | # For the website we need to setup the path to the generated LLDB module that
|
|
42 | 45 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
43 | 46 | extensions = ["sphinx.ext.todo", "sphinx.ext.mathjax", "sphinx.ext.intersphinx"]
|
44 | 47 |
|
| 48 | +# When building man pages, we do not use the markdown pages, |
| 49 | +# So, we can continue without the myst_parser dependencies. |
| 50 | +# Doing so reduces dependencies of some packaged llvm distributions. |
| 51 | +try: |
| 52 | + import myst_parser |
| 53 | + |
| 54 | + extensions.append("myst_parser") |
| 55 | +except ImportError: |
| 56 | + if not tags.has("builder-man"): |
| 57 | + raise |
| 58 | + |
| 59 | +# Automatic anchors for markdown titles |
| 60 | +from llvm_slug import make_slug |
| 61 | + |
| 62 | +myst_heading_anchors = 6 |
| 63 | +myst_heading_slug_func = make_slug |
| 64 | + |
45 | 65 | autodoc_default_options = {"special-members": True}
|
46 | 66 |
|
47 | 67 | # Unless we only generate the basic manpage we need the plugin for generating
|
|
69 | 89 | # The suffix of source filenames.
|
70 | 90 | source_suffix = {
|
71 | 91 | ".rst": "restructuredtext",
|
| 92 | + ".md": "markdown", |
72 | 93 | }
|
73 | 94 |
|
74 | 95 | # The encoding of source files.
|
|
0 commit comments