Skip to content

Commit

Permalink
Disable links to empty chapters in book (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jan 22, 2025
1 parent 93a1986 commit ddc9103
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,8 @@ in your editor of choice so that I may include them here.
Quick Start
-----------

See [the installation section](#installation) for how to install `just` on your
computer. Try running `just --version` to make sure that it's installed
correctly.
See the installation section for how to install `just` on your computer. Try
running `just --version` to make sure that it's installed correctly.

For an overview of the syntax, check out
[this cheatsheet](https://cheatography.com/linux-china/cheat-sheets/justfile/).
Expand Down
11 changes: 9 additions & 2 deletions crates/generate-book/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,20 @@ fn main() -> Result {
HeadingLevel::H5 => 4,
HeadingLevel::H6 => 5,
};
writeln!(

write!(
summary,
"{}- [{}]({filename}.md)",
"{}- [{}](",
" ".repeat(indent * 4),
chapter.title(),
)?;

if chapter.events.len() > 3 {
write!(summary, "{filename}.md")?;
}

writeln!(summary, ")")?;

filenames.insert(filename);
}

Expand Down

0 comments on commit ddc9103

Please sign in to comment.