Files
zulip/docs/conf.py
Anders Kaseorg 75525f5b53 docs: Convert .html#fragment links to .md#fragment.
This uses the myst_heading_anchors option to automatically generate
header anchors and make Sphinx aware of them.  See
https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors.

Note: to be compatible with GitHub, MyST-Parser uses a slightly
different convention for .md fragment links than .html fragment links
when punctuation is involved.  This does not affect the generated
fragment links in the HTML output.

Fixes #13264.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 16:28:31 -08:00

58 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# For documentation on Sphinx configuration options, see:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# https://myst-parser.readthedocs.io/en/latest/sphinx/reference.html
# https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html
import os
import sys
from typing import Any
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from version import LATEST_RELEASE_VERSION, ZULIP_VERSION
on_rtd = os.environ.get("READTHEDOCS") == "True"
# General configuration
extensions = [
"myst_parser",
"sphinx_rtd_theme",
]
templates_path = ["_templates"]
project = "Zulip"
copyright = "20122015 Dropbox, Inc., 20152021 Kandra Labs, Inc., and contributors"
author = "The Zulip Team"
version = ZULIP_VERSION
release = ZULIP_VERSION
exclude_patterns = ["_build", "README.md"]
suppress_warnings = [
"myst.header",
]
pygments_style = "sphinx"
# Options for Markdown parser
myst_enable_extensions = [
"colon_fence",
"substitution",
]
myst_heading_anchors = 6
myst_substitutions = {
"LATEST_RELEASE_VERSION": LATEST_RELEASE_VERSION,
}
# Options for HTML output
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"collapse_navigation": not on_rtd, # makes local builds much faster
"logo_only": True,
}
html_logo = "images/zulip-logo.svg"
html_static_path = ["_static"]
def setup(app: Any) -> None:
# overrides for wide tables in RTD theme
app.add_css_file("theme_overrides.css") # path relative to _static