Skip to content

[lldb] Enable support for Markdown documentation pages #89716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lldb/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import sys, os, re, shutil
from datetime import date

# Add path for llvm_slug module.
sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "llvm", "docs")))

building_man_page = tags.has("builder-man")

# For the website we need to setup the path to the generated LLDB module that
Expand Down Expand Up @@ -42,6 +45,23 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.todo", "sphinx.ext.mathjax", "sphinx.ext.intersphinx"]

# 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

myst_heading_anchors = 6
myst_heading_slug_func = make_slug

autodoc_default_options = {"special-members": True}

# Unless we only generate the basic manpage we need the plugin for generating
Expand Down Expand Up @@ -69,6 +89,7 @@
# The suffix of source filenames.
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

# The encoding of source files.
Expand Down