Option C Tools
Loading...
Searching...
No Matches
conf.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# docs/_sphinx/conf.py
4
5"""
6Purpose
7-------
8Sphinx configuration for the OCT project documentation build.
9
10Responsibilities
11----------------
12- Define project metadata (name, version, author, copyright).
13- Register Sphinx extensions (MyST, Mermaid, autodoc, Napoleon, etc.).
14- Configure HTML theme, static paths, and template paths.
15
16Diagnostics
17-----------
18Domain: DOCS
19L2: documentation build configuration
20L3: build configuration details
21L4: deep tracing
22
23Contracts
24---------
25- This file is consumed by ``sphinx-build`` and ``oct docs --sphinx``.
26- Paths in ``templates_path`` and ``html_static_path`` are relative to
27 the confdir (``docs/_sphinx/``).
28"""
29
30# Configuration file for the Sphinx documentation builder.
31#
32# Generated by: oct docs --sphinx / oct scaffold
33# Lives in: docs/_sphinx/conf.py
34
35import os
36import sys
37
38# Allow autodoc to import project modules
39# Path: _sphinx/ → docs/ → project_root/
40sys.path.insert(0, os.path.abspath('../..'))
41
42# -- Project information -----------------------------------------------------
43
44project = 'oct'
45copyright = '2026, Option C Dev Team'
46author = 'Option C Dev Team'
47release = '0.9.1'
48
49# -- General configuration ---------------------------------------------------
50
51extensions = [
52 'myst_parser',
53 'sphinxcontrib.mermaid',
54 'sphinx.ext.autosectionlabel',
55 'sphinx_copybutton',
56 'sphinx.ext.autodoc',
57 'sphinx.ext.autosummary',
58 'sphinx.ext.viewcode',
59 'sphinx.ext.inheritance_diagram',
60 'sphinx.ext.napoleon',
61]
62
63# Prefix section labels with document name to avoid duplicates across modules
64autosectionlabel_prefix_document = True
65
66myst_enable_extensions = [
67 'colon_fence',
68 'attrs_inline',
69 'smartquotes',
70 'replacements',
71]
72
73myst_heading_anchors = 3
74
75# Convert ```mermaid fenced blocks to Sphinx mermaid directives
76myst_fence_as_directive = {"mermaid"}
77
78# templates_path and html_static_path are relative to confdir (docs/_sphinx/)
79templates_path = ['../_templates']
80exclude_patterns = ['html', 'doctrees', 'old', 'code_reviews', 'sphinx_docs',
81 'source', '_sphinx', '_templates', '_autosummary',
82 'doxygen_output', 'doxygen_work_dir',
83 'Thumbs.db', '.DS_Store']
84
85# Suppress noisy warnings from markdown files
86suppress_warnings = ['myst.xref_missing', 'myst.header', 'docutils',
87 'autosectionlabel.*']
88
89# -- Autodoc configuration --------------------------------------------------
90
91autosummary_generate = True
92
93autodoc_default_options = {
94 'members': True,
95 'undoc-members': True,
96 'show-inheritance': True,
97}
98
99# -- Options for HTML output -------------------------------------------------
100
101html_theme = 'sphinx_book_theme'
102html_static_path = ['../_static']
103html_css_files = ['custom.css']
104html_logo = '../_static/Option_C_logo.svg'
105
106html_theme_options = {
107 "repository_url": "https://github.com/available/soon",
108 "use_repository_button": True,
109 "use_fullscreen_button": True,
110 "use_download_button": True,
111 "home_page_in_toc": True,
112 "show_toc_level": 2,
113}