rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.84k stars 1.62k forks source link

Add the possibility to link to headings of another markdown file inside SUMMARY.md #2436

Closed Haislich closed 2 weeks ago

Haislich commented 2 weeks ago

Problem

There are times in which inside a chapter there are a lot of concepts, but each concept is small. Also, since there are a lot of concepts, getting a good TOC would be great. As far as the documentation about SUMMARY.md is concerned each subchapter should be stored in it's markdown specific file. Inside markdown linking to specific headers inside a markdown file is allowed, thus having a chapter_1.md and a SUMMARY.md should be valid.

src/chapter_1.md

# Chapter 

bla bla bla

## Chapter 1.1

Again some bla bla, but 1.1

src/SUMMARY.md

# Summary

- [Chapter 1](./chapter_1.md/#chapter-11)
  -[Chapter 1.2](./chapter_1.md/#chapter-12)

mdbook v0.4.40 responds:

2024-09-11 18:50:20 [ERROR] (mdbook::utils): Error: Unable to create missing chapters
2024-09-11 18:50:20 [ERROR] (mdbook::utils):    Caused By: Unable to create missing file: ~\books\test_book\src\./chapter_1.md/#chapter-11
2024-09-11 18:50:20 [ERROR] (mdbook::utils):    Caused By: The system cannot find the path specified. (os error 3)

Proposed Solution

No response

Notes

No response

ehuss commented 2 weeks ago

Thanks for the report! Unless I'm mistaken, this looks like a duplicate of #167, so closing in favor of that. If there is a reason to keep this open separately, let us know!