Skip to content

Commit 38bb031

Browse files
committed
docs: preserve legacy notebook URLs with sphinxext-rediraffe
Add sphinxext-rediraffe to the docs extras and configure a 31-entry rediraffe_redirects map in conf.py so old notebook URLs (e.g. notebooks/its_pymc.html) redirect to the new descriptive slugs. Protects social-media and blog links that point at the historical URLs. Refs #840.
1 parent 738a895 commit 38bb031

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

docs/source/conf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,48 @@
7575
"sphinx_design",
7676
"sphinx_sitemap",
7777
"sphinx_togglebutton",
78+
"sphinxext.rediraffe",
7879
"strip_citation_labels",
7980
]
8081

82+
# -- Redirects for renamed notebooks (issue #840) ---------------------------
83+
# Maps old docnames to new docnames so legacy URLs keep resolving.
84+
rediraffe_redirects = {
85+
"notebooks/ancova_pymc": "notebooks/ancova-pymc",
86+
"notebooks/did_pymc": "notebooks/difference-in-differences-pymc",
87+
"notebooks/did_pymc_banks": "notebooks/difference-in-differences-banks-pymc",
88+
"notebooks/did_skl": "notebooks/difference-in-differences-sklearn",
89+
"notebooks/geolift1": "notebooks/geolift-single-cell",
90+
"notebooks/inv_prop_latent": "notebooks/inverse-propensity-latent",
91+
"notebooks/inv_prop_pymc": "notebooks/inverse-propensity-pymc",
92+
"notebooks/its_covid": "notebooks/interrupted-time-series-covid",
93+
"notebooks/its_lift_test": "notebooks/interrupted-time-series-lift-test",
94+
"notebooks/its_post_intervention_analysis": "notebooks/interrupted-time-series-post-intervention-analysis",
95+
"notebooks/its_pymc": "notebooks/interrupted-time-series-pymc",
96+
"notebooks/its_pymc_comparative": "notebooks/interrupted-time-series-comparative-pymc",
97+
"notebooks/its_skl": "notebooks/interrupted-time-series-sklearn",
98+
"notebooks/iv_pymc": "notebooks/instrumental-variables-pymc",
99+
"notebooks/iv_vs_priors": "notebooks/instrumental-variables-variable-selection-priors",
100+
"notebooks/iv_weak_instruments": "notebooks/instrumental-variables-weak-instruments",
101+
"notebooks/multi_cell_geolift": "notebooks/multi-cell-geolift",
102+
"notebooks/panel_fixed_effects": "notebooks/panel-fixed-effects",
103+
"notebooks/piecewise_its_pymc": "notebooks/piecewise-interrupted-time-series-pymc",
104+
"notebooks/pipeline_workflow": "notebooks/pipeline-workflow",
105+
"notebooks/rd_donut_pymc": "notebooks/regression-discontinuity-donut-pymc",
106+
"notebooks/rd_pymc": "notebooks/regression-discontinuity-pymc",
107+
"notebooks/rd_pymc_drinking": "notebooks/regression-discontinuity-drinking-pymc",
108+
"notebooks/rd_skl": "notebooks/regression-discontinuity-sklearn",
109+
"notebooks/rd_skl_drinking": "notebooks/regression-discontinuity-drinking-sklearn",
110+
"notebooks/report_demo": "notebooks/reporting-demo",
111+
"notebooks/rkink_pymc": "notebooks/regression-kink-pymc",
112+
"notebooks/sc_pymc": "notebooks/synthetic-control-pymc",
113+
"notebooks/sc_pymc_brexit": "notebooks/synthetic-control-brexit-pymc",
114+
"notebooks/sc_skl": "notebooks/synthetic-control-sklearn",
115+
"notebooks/staggered_did_pymc": "notebooks/staggered-difference-in-differences-pymc",
116+
}
117+
rediraffe_branch = "main"
118+
rediraffe_auto_redirect_perc = 0
119+
81120
nb_execution_mode = "off"
82121

83122
# configure copy button to avoid copying sphinx or console characters

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ docs = [
9595
"ipywidgets",
9696
"sphinx-design",
9797
"sphinx-togglebutton",
98+
"sphinxext-rediraffe",
9899
]
99100
lint = ["interrogate", "prek", "ruff", "mypy"]
100101
test = ["pytest", "pytest-cov", "codespell", "nbformat", "nbconvert", "papermill"]

0 commit comments

Comments
 (0)