Skip to content

what-changed: make inline citation links resolve - #145

Closed
gas2own wants to merge 2 commits into
mainfrom
what-changed-citation-links
Closed

gas2own wants to merge 2 commits into
mainfrom
what-changed-citation-links

Conversation

@gas2own

@gas2own gas2own commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What: On the "what changed" preview page, inline citation links (Quarto renders e.g. "He et al. 2026" as <a href="#ref-<key>" role="doc-biblioref">) now point at the full page's bibliography, <page>.html#ref-<key>, instead of a same-page #ref-<key> anchor.

Why: The page copies only the changed sections, so the bibliography entries those anchors target aren't on it, and clicking a citation did nothing.

How: A small link_citations() helper rewrites href="#ref-…" in each embedded section body to the same deep link the section title already uses (the preview URL plus the page path, or the bare relative path). Removed pages are left alone since they have no full page to link to.

Tested: Added test_citation_links_point_at_the_full_page_bibliography, which covers both relative and absolute preview URLs. pytest tests/test_what_changed.py passes (21 tests), and ruff format/ruff check are clean.

AI-review: skipped — small script fix; human review requested directly

Suggested-by: @jbragg

🤖 Generated with Claude Code

@gas2own

gas2own commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Updated with current main (v0.109.0) in 57528ce, a clean merge. tests/test_what_changed.py and tests/test_workspace_what_changed.py pass locally (122 passed, 2 skipped). This PR conflicts with #143 in what-changed.py, so whichever of the two merges second needs a rebase. #201 does not change or supersede it.

@gas2own

gas2own commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

The citation-link implementation and regression test are folded into #290 so the consolidation has one implementation PR.

@gas2own gas2own closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant