Skip to content

Commit 2a951cc

Browse files
committed
feat(docs): configure the ccpbiosim sphinx theme and sphinx-autoapi
1 parent 636d4d3 commit 2a951cc

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

docs/conf.py renamed to docs/source/conf.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
import sys
1111
import time
1212

13-
# Ensure the *repo root* is on sys.path so autodoc imports the local package.
14-
# This works whether conf.py is in docs/ or docs/source/.
13+
# Put the repo root on sys.path so the local package can be imported.
1514
DOCS_DIR = os.path.abspath(os.path.dirname(__file__))
16-
REPO_ROOT = os.path.abspath(os.path.join(DOCS_DIR, ".."))
15+
REPO_ROOT = os.path.abspath(os.path.join(DOCS_DIR, "..", ".."))
1716
sys.path.insert(0, REPO_ROOT)
1817

1918
# -- Project information -----------------------------------------------------
@@ -42,8 +41,7 @@
4241
"sphinx.ext.napoleon",
4342
"sphinx.ext.intersphinx",
4443
"sphinx.ext.extlinks",
45-
"nbsphinx",
46-
"sphinx_copybutton",
44+
"autoapi.extension",
4745
]
4846

4947
# Autosummary (API stubs)
@@ -58,8 +56,22 @@
5856
napoleon_use_rtype = True
5957
napoleon_use_ivar = True
6058

61-
# (Optional) If some modules have optional heavy deps, you can mock them here:
62-
autodoc_mock_imports = ["MDAnalysis", "rdkit"]
59+
# API reference generated from the source by sphinx-autoapi
60+
autoapi_dirs = ["../../CodeEntropy"]
61+
autoapi_root = "reference"
62+
autoapi_add_toctree_entry = False
63+
autoapi_member_order = "groupwise"
64+
autoapi_options = [
65+
"members",
66+
"undoc-members",
67+
"show-inheritance",
68+
"show-module-summary",
69+
]
70+
71+
# Show type hints in the parameter list rather than the signature
72+
autodoc_typehints = "description"
73+
add_module_names = False
74+
python_maximum_signature_line_length = 88
6375

6476
templates_path = ["_templates"]
6577

@@ -72,11 +84,8 @@
7284
pygments_style = "default"
7385

7486
# -- Options for HTML output -------------------------------------------------
75-
html_theme = "furo"
76-
html_theme_options = {
77-
"dark_logo": "logos/biosim-codeentropy_logo_light.png",
78-
"light_logo": "logos/biosim-codeentropy_logo_dark.png",
79-
}
87+
html_theme = "ccpbiosim_sphinx_theme"
88+
html_context = {"github_repo": "CodeEntropy"}
8089

8190
html_static_path = ["_static"]
8291

0 commit comments

Comments
 (0)