docs: restore per-document bibliographies after sphinxcontrib-bibtex 2.7.0#909
docs: restore per-document bibliographies after sphinxcontrib-bibtex 2.7.0#909anevolbap wants to merge 2 commits into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #909 +/- ##
=======================================
Coverage 95.51% 95.51%
=======================================
Files 98 98
Lines 15868 15868
Branches 931 931
=======================================
Hits 15157 15157
Misses 504 504
Partials 207 207 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Documentation build overview
516 files changed ·
|
Automated triageRecommendation: Why:
Review focus:
Confidence: high |
…2.7.0 Reverts the centralization done in pymc-labs#834. With sphinxcontrib-bibtex 2.7.0 (released 2026-05-06), citation hyperlinks resolve to the same page when the citing document has its own bibliography block, even when other documents register the same key. This removes the UX regression that forced the central-page workaround. - pyproject.toml: pin sphinxcontrib-bibtex>=2.7.0 - conf.py: suppress duplicate_citation/duplicate_label, revert default style alpha->unsrt, drop strip_citation_labels extension and custom.css hanging-indent rule - delete _extensions/strip_citation_labels.py, _static/custom.css, references.rst - knowledgebase/index.md: drop ../references toctree entry - restore '## References' + bibliography block in 22 docs (3 markdown + 19 notebooks). Two extra notebooks that always cited keys without a per-doc bib (structural_causal_models.ipynb, iv_vs_priors.ipynb) now also have one, since cross-doc resolution no longer covers them by default. Closes pymc-labs#870.
…ence The references.bib entry has always been goodmanbacon2021difference, but four citations across three docs used a misspelled goodman2021difference that had never resolved. Fixes the resulting bibtex.key_not_found warnings flagged during the per-document bibliography revert build.
adda79f to
521cfdf
Compare
|
Rebased onto
The rebase also exposed a regression: |
Closes #870. Supersedes #905 (the panel_fixed_effects bibliography cell stays in place under this approach, so the cleanup PR is no longer needed).
Update (rebased onto main)
Rebased onto
mainafter #840 renamed all how-to notebooks (underscore -> hyphenated) and added the gallery plussphinxext.redirafferedirects. Reconciliation inconf.py: kept the gallery, rediraffe, and main'ssuppress_warnings; droppedcustom.cssfromhtml_css_files(keptgallery.css); still dropstrip_citation_labelsand setbibtex_default_style = "unsrt".Two follow-on fixes surfaced during the rebase:
goodman2021differencecite-key typo is now fixed in this PR, not deferred.interrupted-time-series-causalpy-vs-causalimpact.ipynb(new on main, added after this PR was written) citedbrodersen2015inferringwith no per-doc bibliography. Withreferences.rstremoved, that citation no longer resolved, so the notebook got a bibliography cell too.Verified with two local
sphinx-buildruns on the docs extra (resolvessphinxcontrib-bibtex 2.7.0): both exit 0, zerobibtexwarnings of any kind, andduplicate_local_citation= 0 (the category is left unsuppressed, so it would surface any genuine same-page duplicate).prekpasses on the changed files.Why
#834 centralized 22 per-document
:::{bibliography}:::blocks into a single globalreferences.rstto silencebibtex.duplicate_citationwarnings. The deeper reason was that on sphinxcontrib-bibtex 2.6.x, citation hyperlinks resolved non-deterministically across documents (a{cite:t}on page A could link to page B's bibliography). The trade-off was a UX regression: readers leaving the page they were on to see a reference.sphinxcontrib-bibtex 2.7.0(PyPI, 2026-05-06) addresses that with same-document-preferred resolution (upstream issue #385 / PR #387) and a newduplicate_local_citationwarning category that lets us suppress only the cross-document noise.Changes
pyproject.toml: pinsphinxcontrib-bibtex>=2.7.0.docs/source/conf.py: keep main'ssuppress_warnings(toc.not_included,bibtex.duplicate_label,bibtex.duplicate_citation; same-page duplicates still surface asbibtex.duplicate_local_citation). Revertbibtex_default_stylefrom"alpha"to"unsrt". Drop thestrip_citation_labelsextension and its_extensionspath. Dropcustom.cssfromhtml_css_files(the hanging-indent rule was tuned for the centralized page).docs/source/_extensions/strip_citation_labels.py,docs/source/_static/custom.css,docs/source/references.rst. Drop../referencesfrom the knowledgebase toctree.## References+:::{bibliography}:filter: docname in docnames:::across the how-to notebooks and knowledgebase docs. Notebooks that cite keys without a per-doc bib (structural_causal_models.ipynb,iv_vs_priors.ipynb, andinterrupted-time-series-causalpy-vs-causalimpact.ipynb) also got one, since cross-doc resolution no longer covers them under same-document-first behavior.Notebook handling
Edits use raw JSON manipulation that preserves each notebook's original indent and key ordering, so diffs are minimal: each touched notebook adds 11-12 lines (the new markdown cell only). Outputs were not re-executed because no code cell changed; the appended cell is markdown only.
Out of scope