| 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 |
# -- Path setup -------------------------------------------------------------- |
| 7 |
|
| 8 |
import os |
| 9 |
import sys |
| 10 |
|
| 11 |
sys.path.insert(0, os.path.abspath("..")) |
| 12 |
|
| 13 |
|
| 14 |
# -- Project information ----------------------------------------------------- |
| 15 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 16 |
|
| 17 |
project = "bpack" |
| 18 |
copyright = "2020-2024, Antonio Valentino" # noqa: D100 |
| 19 |
author = "Antonio Valentino" |
| 20 |
|
| 21 |
# The full version, including alpha/beta/rc tags |
| 22 |
import bpack # noqa: E402 |
| 23 |
|
| 24 |
release = bpack.__version__ |
| 25 |
|
| 26 |
master_doc = "index" |
| 27 |
|
| 28 |
|
| 29 |
# -- General configuration --------------------------------------------------- |
| 30 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 31 |
|
| 32 |
extensions = [ |
| 33 |
"sphinx.ext.autodoc", |
| 34 |
"sphinx.ext.autosectionlabel", |
| 35 |
# "sphinx.ext.autosummary", |
| 36 |
"sphinx.ext.coverage", |
| 37 |
"sphinx.ext.doctest", |
| •38 |
# "sphinx.ext.duration", |
| 39 |
"sphinx.ext.extlinks", |
| 40 |
# "sphinx.ext.githubpages", |
| 41 |
# "sphinx.ext.graphviz", |
| 42 |
"sphinx.ext.ifconfig", |
| 43 |
# "sphinx.ext.imgconverter", |
| 44 |
"sphinx.ext.inheritance_diagram", |
| 45 |
"sphinx.ext.intersphinx", |
| 46 |
# "sphinx.ext.linkcode", # needs_sphinx = "1.2" |
| 47 |
# "sphinx.ext.napoleon", |
| 48 |
"sphinx.ext.todo", |
| 49 |
"sphinx.ext.viewcode", |
| 50 |
# "sphinx.ext.imgmath", |
| 51 |
# "sphinx.ext.jsmath", |
| 52 |
# "sphinx.ext.mathjax", |
| 53 |
"sphinx_rtd_theme", |
| 54 |
] |
| 55 |
|
| 56 |
try: |
| 57 |
import sphinxcontrib.spelling # noqa: F401 |
| 58 |
except ImportError: |
| 59 |
pass |
| 60 |
else: |
| 61 |
extensions.append("sphinxcontrib.spelling") |
| 62 |
|
| 63 |
templates_path = ["_templates"] |
| 64 |
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 65 |
|
| 66 |
|
| 67 |
# -- Options for HTML output ------------------------------------------------- |
| 68 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 69 |
|
| 70 |
html_theme = "sphinx_rtd_theme" |
| 71 |
html_static_path = ["_static"] |
| 72 |
html_theme_options = { |
| 73 |
# 'vcs_pageview_mode': 'blob', |
| 74 |
} |
| 75 |
html_context = { |
| 76 |
# 'github_url': 'https://github.com/avalentino/bpack/', |
| 77 |
"display_github": True, |
| 78 |
"github_user": "avalentino", |
| 79 |
"github_repo": "bpack", |
| 80 |
"github_version": "main", |
| 81 |
"conf_py_path": "/docs/", # Path in the checkout to the docs root |
| 82 |
} |
| 83 |
|
| 84 |
html_last_updated_fmt = "" |
| 85 |
|
| 86 |
|
| 87 |
# -- Options for LaTeX output ------------------------------------------------ |
| 88 |
latex_documents = [ |
| 89 |
# (startdocname, targetname, title, author, theme, toctree_only) |
| 90 |
( |
| 91 |
project, |
| 92 |
project + ".tex", |
| 93 |
"Binary data structures (un-)Packing library", |
| 94 |
author, |
| 95 |
"manual", |
| 96 |
False, |
| 97 |
), |
| 98 |
] |
| 99 |
|
| 100 |
latex_domain_indices = False |
| 101 |
|
| 102 |
latex_elements = { |
| 103 |
# 'papersize': 'a4paper', |
| 104 |
"pointsize": "12pt", |
| 105 |
} |
| 106 |
|
| 107 |
|
| 108 |
# -- Extension configuration ------------------------------------------------- |
| 109 |
|
| 110 |
# -- Options for autodoc extension ------------------------------------------- |
| 111 |
# autoclass_content = 'both' |
| 112 |
autodoc_member_order = "groupwise" |
| 113 |
# autodoc_default_options = { |
| 114 |
# "members": True, |
| 115 |
# "undoc-members": True, |
| 116 |
# "show-inheritance": True, |
| 117 |
# } |
| 118 |
autodoc_mock_imports = [] |
| 119 |
for module_name in ["bitarray", "bitstruct", "numpy"]: |
| 120 |
try: |
| 121 |
__import__(module_name) |
| 122 |
except ImportError: |
| 123 |
autodoc_mock_imports.append(module_name) |
| 124 |
|
| 125 |
|
| 126 |
# -- Options for autosummary extension --------------------------------------- |
| 127 |
autosummary_generate = True |
| 128 |
# autosummary_mock_imports = [] |
| 129 |
# autosummary_ignore_module_all = False |
| 130 |
|
| 131 |
|
| 132 |
# -- Options for intersphinx extension --------------------------------------- |
| 133 |
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration |
| 134 |
|
| 135 |
intersphinx_mapping = { |
| 136 |
"python": ("https://docs.python.org/3/", None), |
| 137 |
"numpy": ("https://numpy.org/doc/stable/", None), |
| 138 |
} |
| 139 |
|
| 140 |
|
| 141 |
# -- Options for extlinks extension ------------------------------------------ |
| 142 |
|
| 143 |
extlinks = { |
| 144 |
"issue": ("https://github.com/avalentino/bpack/issues/%s", "gh-%s"), |
| 145 |
} |
| 146 |
|
| 147 |
|
| 148 |
# -- Options for todo extension ---------------------------------------------- |
| 149 |
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration |
| 150 |
|
| 151 |
todo_include_todos = True |