Files
muSRFlow/docs/source/conf.py
T

95 lines
2.6 KiB
Python

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the Sphinx documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import json
import os
import sys
# -- Path setup -------------------------------------------------------------
# Include the repo root so the version can be read from package.json.
source_dir = os.path.dirname(os.path.abspath(__file__))
repo_root = os.path.abspath(os.path.join(source_dir, "..", ".."))
if repo_root not in sys.path:
sys.path.insert(0, repo_root)
# -- Project information -----------------------------------------------------
def load_version():
try:
with open(os.path.join(repo_root, "package.json"), "r", encoding="utf-8") as handle:
package = json.load(handle)
version = str(package.get("version", "0.0.0"))
except Exception:
version = "0.0.0"
# Sphinx wants (version, release). Keep them equal; release may carry the
# pre-release suffix while version is the plain package version.
return version, version
version, release = load_version()
project = "muSRFlow"
copyright = "2026 Zaher Salman"
author = "Zaher Salman"
# -- General configuration ---------------------------------------------------
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The name of the document that Sphinx will place at the root of the build.
master_doc = "index"
root_doc = "index"
# -- Options for HTML output -------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = project + " User Manual"
html_theme_options = {
"navigation_depth": 3,
"titles_only": False,
}
# -- Options for LaTeX output ------------------------------------------------
latex_engine = "xelatex"
# The standard `makeindex` tool is used for the alphabetical index instead of
# xindy, so the PDF build does not depend on the optional xindy Perl bundle.
latex_use_xindy = False
latex_elements = {
"classoptions": ",12pt",
"papersize": "a4paper",
"pointsize": "12pt",
"sphinxsetup": "hmargin={2cm,2cm}, vmargin={2cm,3cm}",
# Keep hyperlinks readable in print.
"fncychap": r"\usepackage[Sonny]{fncychap}",
}
latex_documents = [
(
master_doc,
"muSRFlow.tex",
project + " User Manual",
author,
"manual",
False,
),
]