Skip to content

Commit 59f9b70

Browse files
committed
fix: docs
1 parent cf7b404 commit 59f9b70

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

.github/workflows/sphinx-docs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
run: |
5656
mkdir -p "blog-repo/${BLOG_DEST}"
5757
rsync -av --delete docs/build/ "blog-repo/${BLOG_DEST}/"
58-
ls -la "blog-repo/${BLOG_DEST}" | sed -n '1,80p'
5958
6059
- name: Commit and push changes to blog
6160
run: |

docs/source/conf.py

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
11
import os
2+
import sys
23
from datetime import datetime
34
from importlib import metadata
45

5-
# Project information
6+
# Include src directory for autodoc
7+
sys.path.insert(0, os.path.abspath("../../src"))
8+
9+
# -- Project information -----------------------------------------------------
10+
611
project = "gen_surv"
712
copyright = f"{datetime.now().year}, Diogo Ribeiro"
813
author = "Diogo Ribeiro"
9-
release = metadata.version("gen_surv")
14+
15+
# Get version from installed package metadata
16+
try:
17+
release = metadata.version("gen_surv")
18+
except metadata.PackageNotFoundError:
19+
release = "0.0.0" # fallback for local builds
1020
version = release
1121

12-
# General configuration
22+
# -- General configuration ---------------------------------------------------
23+
1324
extensions = [
1425
"sphinx.ext.autodoc",
1526
"sphinx.ext.napoleon",
1627
"sphinx.ext.viewcode",
1728
"sphinx.ext.intersphinx",
1829
"sphinx.ext.autosummary",
19-
"sphinx.ext.githubpages",
30+
"sphinx.ext.githubpages", # includes .nojekyll
2031
"myst_parser",
2132
"sphinx_copybutton",
2233
"sphinx_design",
2334
"sphinx_autodoc_typehints",
2435
]
2536

26-
# MyST Parser configuration
37+
autosummary_generate = True
38+
39+
autodoc_default_options = {
40+
"members": True,
41+
"member-order": "bysource",
42+
"special-members": "__init__",
43+
"undoc-members": True,
44+
"exclude-members": "__weakref__",
45+
}
46+
47+
# MyST Markdown extensions
2748
myst_enable_extensions = [
2849
"colon_fence",
2950
"deflist",
@@ -36,19 +57,6 @@
3657
"tasklist",
3758
]
3859

39-
# Autodoc configuration
40-
autodoc_default_options = {
41-
"members": True,
42-
"member-order": "bysource",
43-
"special-members": "__init__",
44-
"undoc-members": True,
45-
"exclude-members": "__weakref__",
46-
}
47-
48-
# Autosummary
49-
autosummary_generate = True
50-
51-
# Napoleon settings
5260
napoleon_google_docstring = True
5361
napoleon_numpy_docstring = True
5462
napoleon_include_init_with_doc = False
@@ -61,15 +69,15 @@
6169
"pandas": ("https://pandas.pydata.org/docs/", None),
6270
}
6371

64-
# Disable fetching remote inventories when network access is unavailable
72+
# Disable fetching intersphinx inventories on CI (e.g., for offline builds)
6573
if os.environ.get("SKIP_INTERSPHINX", "1") == "1":
6674
intersphinx_mapping = {}
6775

68-
# HTML theme options
76+
# -- HTML output configuration ----------------------------------------------
77+
6978
html_theme = "sphinx_rtd_theme"
7079
html_theme_options = {
7180
"canonical_url": "https://gensurvpy.readthedocs.io/",
72-
"analytics_id": "",
7381
"logo_only": False,
7482
"prev_next_buttons_location": "bottom",
7583
"style_external_links": False,
@@ -81,12 +89,19 @@
8189
"titles_only": False,
8290
}
8391

92+
# Static assets
8493
html_static_path = ["_static"]
8594
html_css_files = ["custom.css"]
8695

96+
# Add .nojekyll so GitHub Pages serves _static and other underscored folders
97+
html_extra_path = [".nojekyll"]
98+
99+
# Required for correct link rendering on GitHub Pages under a subpath
100+
html_baseurl = "https://diogoribeiro7.github.io/packages/gensurvpy/"
101+
87102
# Output file base name for HTML help builder
88103
htmlhelp_basename = "gensurvdoc"
89104

90-
# Copy button configuration
105+
# Copy button config for code blocks
91106
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
92107
copybutton_prompt_is_regexp = True

0 commit comments

Comments
 (0)