Skip to content

feat!: link RFDs with xref and Asciidoctor default section ids - #3

Merged
darwin67 merged 1 commit into
mainfrom
xref-default-ids
Oct 21, 2026
Merged

darwin67 merged 1 commit into
mainfrom
xref-default-ids

Conversation

@darwin67

Copy link
Copy Markdown
Member

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, not goal). GitHub and Asciidoctor both render these with stock settings, so repositories no longer need :idprefix:/:idseparator: overrides.

  • rfdtool link writes xref: cross references.
  • rfdtool check rejects link:../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).
  • On a final RFD, replacing link: macros with cross references, including their anchors, is still allowed.
  • The public-to-private visibility check still covers link: into another RFD's directory, such as link:../0002/IMPLEMENTATION.adoc[...].
  • The built-in template drops the idprefix/idseparator attributes.
  • README↔checklist links (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 running nix flake update rfdtool. ryusen-sys/rfd already uses this format and passes unchanged.

Verification: go test, golangci-lint, gofmt, and nix flake check pass. On ryusen-sys/rfd, rfdtool check passes, and after rfdtool link on a scratch copy the site's tests pass, including rendering every RFD and resolving every link.

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.
@darwin67
darwin67 merged commit 59244cb into main Oct 21, 2026
3 checks passed
@darwin67
darwin67 deleted the xref-default-ids branch October 21, 2026 08:44
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