Skip to content

[Docs] Allow building man pages without myst_parser #82402

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 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion clang/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,17 @@

import sphinx

if sphinx.version_info >= (3, 0):
# 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


# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down
13 changes: 12 additions & 1 deletion flang/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,24 @@
# 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.todo",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
]

# 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"]
myst_heading_anchors = 6
Expand Down
13 changes: 12 additions & 1 deletion llvm/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,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 = ["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
Expand Down