|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# For the full list of built-in configuration values, see the documentation: |
| 4 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 | + |
| 6 | +# -- Project information ----------------------------------------------------- |
| 7 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 8 | + |
| 9 | +from datetime import datetime |
| 10 | +from pathlib import Path |
| 11 | +import tomllib |
| 12 | + |
| 13 | +_project_data = tomllib.loads( |
| 14 | + (Path(__file__).parent.parent / "pyproject.toml").read_text("utf8") |
| 15 | +)["project"] |
| 16 | + |
| 17 | +project = _project_data["name"] |
| 18 | +author = _project_data["authors"][0]["name"] |
| 19 | +copyright = f"{datetime.now().year}, {author}" |
| 20 | +version = release = _project_data["version"] |
| 21 | + |
| 22 | +# -- General configuration --------------------------------------------------- |
| 23 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 24 | + |
| 25 | +extensions = [ |
| 26 | + "sphinx_design", |
| 27 | + "sphinx_needs", |
| 28 | + "sphinx_codelinks", |
| 29 | + "sphinx.ext.intersphinx", |
| 30 | + "sphinx_code_tabs", |
| 31 | + "sphinxcontrib.typer", |
| 32 | +] |
| 33 | + |
| 34 | +# exclude_patterns = [] |
| 35 | +templates_path = ["_templates"] |
| 36 | +show_warning_types = True |
| 37 | + |
| 38 | +todo_include_todos = True |
| 39 | + |
| 40 | +# -- Options for intersphinx extension --------------------------------------- |
| 41 | + |
| 42 | +intersphinx_mapping = { |
| 43 | + "needs": ("https://sphinx-needs.readthedocs.io/en/latest/", None), |
| 44 | + "sphinx": ("https://www.sphinx-doc.org/en/master", None), |
| 45 | +} |
| 46 | + |
| 47 | +# -- Options for HTML output ------------------------------------------------- |
| 48 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 49 | + |
| 50 | +html_title = "CodeLinks" |
| 51 | +html_theme = "furo" |
| 52 | +# original source is in ubdocs repo at docs/developer_handbook/design/files/ubcode_favicon/favicon.ico |
| 53 | +html_favicon = "source/_static/favicon.ico" |
| 54 | +html_static_path = ["source/_static"] |
| 55 | + |
| 56 | +html_theme_options = { |
| 57 | + "sidebar_hide_name": True, |
| 58 | + "top_of_page_buttons": ["view", "edit"], |
| 59 | + "source_repository": "https://github.com/useblocks/sphinx-codelinks", |
| 60 | + "source_branch": "main", |
| 61 | + "source_directory": "docs/source/", |
| 62 | + "light_logo": "sphinx-codelinks-logo_dark.svg", |
| 63 | + "dark_logo": "sphinx-codelinks-logo_light.svg", |
| 64 | +} |
| 65 | +html_css_files = ["furo.css"] |
| 66 | + |
| 67 | +src_trace_config_from_toml = "./src_trace.toml" |
0 commit comments