-
Notifications
You must be signed in to change notification settings - Fork 370
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
maint: Restructure docs configuration file and improve docs pages #3615
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,69 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
|
||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
# sys.path.insert(0, os.path.abspath('.')) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = "mamba" | ||
copyright = "2020, QuantStack & mamba contributors" # noqa | ||
copyright = "2024, QuantStack & mamba contributors" | ||
author = "QuantStack & mamba contributors" | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = "0.5.2" | ||
|
||
version = "latest" | ||
release = "latest" | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
# Load local extensions (e.g. mermaid) | ||
sys.path.insert(0, str(Path.cwd().resolve() / "tools")) | ||
extensions = [] | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ["mermaid", "mermaid_inheritance", "myst_parser", "breathe"] | ||
|
||
# Configuration of Breathe Doxygen interopt | ||
breathe_projects = {"libmamba": os.environ.get("MAMBA_DEV_DOXYGEN_XML_DIR", "../xml")} | ||
breathe_default_project = "libmamba" | ||
breathe_default_members = ("members", "undoc-members") | ||
breathe_show_include = False | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = [] | ||
|
||
language = "en" | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = "alabaster" | ||
html_static_path = ["_static"] | ||
|
||
# The file above was generated using sphinx 8.1.3 with this command: | ||
# sphinx-quickstart --project "mamba" --author "QuantStack & mamba contributors" -v "latest" -r "latest" -l en --no-sep --no-makefile --no-batchfile | ||
# These are custom options for this project | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "sphinx_book_theme" | ||
html_logo = "_static/logo.png" | ||
html_title = "documentation" | ||
|
||
html_theme_options = { | ||
"path_to_docs": "docs/source", | ||
"repository_branch": "main", | ||
"repository_url": "https://github.com/mamba-org/mamba", | ||
"use_download_button": True, | ||
"use_edit_page_button": True, | ||
"use_issues_button": True, | ||
Comment on lines
+41
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a few nice options here, which add a few buttons under GitHub logo and also make issues links more beautiful (if there will be any) |
||
"use_repository_button": True, | ||
} | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ["_static"] | ||
import os # noqa: E402 | ||
import sys # noqa: E402 | ||
from pathlib import Path # noqa: E402 | ||
|
||
# Load local extensions (e.g. mermaid) | ||
sys.path.insert(0, str(Path.cwd().resolve() / "tools")) | ||
|
||
# Add Sphinx extension modules | ||
extensions = ["mermaid", "mermaid_inheritance", "myst_parser", "breathe"] | ||
|
||
# Configuration of Breathe Doxygen interopt | ||
breathe_projects = {"libmamba": os.environ.get("MAMBA_DEV_DOXYGEN_XML_DIR", "../xml")} | ||
breathe_default_project = "libmamba" | ||
breathe_default_members = ("members", "undoc-members") | ||
breathe_show_include = False | ||
|
||
# Configure links which should be ignored during linkcheck | ||
linkcheck_ignore = [ | ||
r".*github\.com.*#", # javascript based anchors | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub Readme files have javascript based anchors, which causes |
||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows to have really simple configuration file for understanding, where you can easily see, which part of the docs is the standard config, and which is custom for this project.
Updating to new sphinx versions becomes easier and overall we have better distinction between generated code and handwritten.