Skip to content

refactor RFC generation#602

Merged
nikomatsakis merged 6 commits intorust-lang:mainfrom
nikomatsakis:main
Mar 19, 2026
Merged

refactor RFC generation#602
nikomatsakis merged 6 commits intorust-lang:mainfrom
nikomatsakis:main

Conversation

@nikomatsakis
Copy link
Contributor

@nikomatsakis nikomatsakis commented Mar 18, 2026

This PR refactors the RFC generation--

We now start from the NNNN/README.md, walk down the page, and expand * [Chapter](./chapter.md) to be captured inline. When we do that, we adjust the heading levels to fit it all together.

Rendered

The link-list lines had ./2026/highlights.md instead of
./highlights.md — these are relative to the README's own
directory, so the 2026/ prefix was wrong.
Instead of hardcoding #### for highlight goal sections, search
backwards from the directive for the most recent heading and
generate sub-headings one level deeper. This produces correct
heading hierarchies regardless of where the directive appears.
- Resolve link-list paths via Path::join against book_dir instead
  of regex-extracting the stem, so any relative path works.
- Track current heading level while processing the index and pass
  it to inline_rendered_file, which computes the delta between
  the insertion context and the file's top heading. Headings are
  shifted by that delta instead of always bumping +1.
Rewrite the rfc_command.md chapter from a 4-line stub into a
full explanation of the RFC generation pipeline: usage, high-level
overview, detailed step-by-step walkthrough, and backward
compatibility notes.
@nikomatsakis nikomatsakis merged commit 8e09103 into rust-lang:main Mar 19, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from To Do to Done in Triage Queue Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant