Repository navigation
feat(CSwLMeta): add {cref}, cross-references to sections and exercises - #67
Merged
Merged
Conversation
{cref "tag"}[] links to the section with that tag or to the exercise
with that name, and generates the link text from the target: the
section's title, or the exercise's name. Nothing else is added; the
prose says what is cited. The text is filled in during traversal, so
the HTML and the generated Lean projects both carry it. An unknown or
ambiguous tag fails the build.
Exercises now get an HTML anchor and register their names in a domain
of their own. The two references in Logic/PL.lean point back at
exercise implication-as-disj, and Logic/Proof.lean links to exercise
prop-exchange. STYLE-CODE.md and STYLE-WRITING.md record the role.
Closes #24.
AI usage: Claude (Anthropic) designed and implemented the role and the
exercise anchors and drafted the style-guide entries; the author
reviewed and approved the changes.
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
{cref "tag"}[], a role that links to the section with thattagor to the exercise with thatname, and generates the link text from the target: the section's title, or the exercise's name in code. Nothing else is added; the prose says what is cited ("no exercício {cref …}[]").{cref "tag"}[texto]keeps hand-written text.ex-<name>) and register their names in a domain of their own.Logic/PL.leanpoint back at exerciseimplication-as-disj, andLogic/Proof.leanlinks to exerciseprop-exchange.STYLE-CODE.mdandSTYLE-WRITING.mdrecord the role.Tested by running the generator for all four variants: anchors, generated text in HTML and in the student
.lean, cross-page and forward references, and a failing build on an unknown tag. LaTeX is not emitted (emitTeX := false), sotoTeXonly renders the text.The role is named
crefbecause Verso already definesManual.xref. Existing{ref}uses are not migrated here.Closes #24.
🤖 Generated with Claude Code