Repository navigation
feat!: link RFDs with xref and Asciidoctor default section ids - #3
Merged
Merged
Conversation
rfdtool now accepts one link format, the one Asciidoctor and GitHub render without extra settings: xref:../NNNN/README.adoc[...], with section ids such as _goal. rfdtool link writes xref, check rejects link: macros to other RFDs, and the template no longer sets idprefix and idseparator. Replacing link: macros with cross references is still allowed on a final RFD. BREAKING CHANGE: link:../NNNN/README.adoc links to other RFDs are rejected, and section anchors use Asciidoctor default ids (_goal, not goal). Repositories that use the old format must migrate before updating rfdtool.
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.
rfdtool now accepts one format for links between RFDs: Asciidoctor's own. That means
xref:../NNNN/README.adoc[...], with Asciidoctor's default section ids (_goal, notgoal). GitHub and Asciidoctor both render these with stock settings, so repositories no longer need:idprefix:/:idseparator:overrides.rfdtool linkwritesxref:cross references.rfdtool checkrejectslink:../NNNN/README.adoc[...]links to other RFDs instead of skipping them. Section anchors are checked against the default ids, matching asciidoctor.js output (the expected ids in the tests were generated with asciidoctor.js 4.1.1).link:macros with cross references, including their anchors, is still allowed.link:into another RFD's directory, such aslink:../0002/IMPLEMENTATION.adoc[...].idprefix/idseparatorattributes.link:IMPLEMENTATION.adoc[...],link:README.adoc[...]) are unchanged.Breaking: repositories that use
link:RFD links or custom section ids, such as renga-dcim/rfd, must migrate before runningnix flake update rfdtool. ryusen-sys/rfd already uses this format and passes unchanged.Verification:
go test,golangci-lint,gofmt, andnix flake checkpass. On ryusen-sys/rfd,rfdtool checkpasses, and afterrfdtool linkon a scratch copy the site's tests pass, including rendering every RFD and resolving every link.