Sub chapters as anchor links to the same chapter
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.2k
- Forks
- 1.9k
- PR merge metrics
- PR metrics pending
Description
Problem
Currently if you want to have sub chapter that point to the same markdown as the chapter you get additional .md and .html files generated:
- [First Chapter](relative/path/to/markdown.md)
- [Second Chapter](relative/path/to/markdown2.md)
- [Sub Chapter](relative/path/to/markdown2.md#sub-chapter)
The least we can do is not generate the html & md files and instead just point to the anchor link in summary.
I will take a look at mdbook code and see if I can open a PR regarding this.
Proposed Solution
No response
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how mdBook reads the SUMMARY.md links and generates output for links with anchors, then inspect the related Rust implementation and tests. Confirm the change with the example where a subchapter points to the same Markdown file, ensuring no extra .md or .html files are generated and the summary link targets the anchor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, rust
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100