You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Draft chapters are chapters without a file and thus content. The purpose of a draft chapter is to signal future chapters still to be written. Or when still laying out the structure of the book to avoid creating the files while you are still changing the structure of the book a lot. Draft chapters will be rendered in the HTML renderer as disabled links in the table of contents, as you can see for the next chapter in the table of contents on the left. Draft chapters are written like normal chapters but without writing the path to the file.
oap@Owens-MBP ~ % mkdir draft-chapters
cat <<EOF > draft-chapters/SUMMARY.md
- [Draft Chapter]()
EOF
RUST_BACKTRACE=1 mdbook-combiner --meta-directory draft-chapters
"draft-chapters"
thread 'main' panicked at /Users/oap/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mdbook-combiner-0.1.15/src/main.rs:169:41:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: core::panicking::panic
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:144:5
3: mdbook_combiner::rebase
4: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
5: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
6: mdbook_combiner::rebase_summary
7: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
8: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
9: mdbook_combiner::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
oap@Owens-MBP ~ %
Possible TODOs:
Improve the error message in case of draft chapters
Support draft chapters
Add a test to cover draft chapters
The text was updated successfully, but these errors were encountered:
Hopefully, a fix for this has just gone in, this project really needs some tests. As it now has at least 1 other user I might have some motivation to add them. #35
Problem
The presence of a draft chapter in a
SUMMARY.md
causesmdbook-combiner
to panic.Details
Per https://rust-lang.github.io/mdBook/format/summary.html
Repro
Steps
Example
Possible TODOs:
The text was updated successfully, but these errors were encountered: