Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index.html fails to be created silently when there is no prefix chapter #1814

Closed
ohemelaar opened this issue Jun 2, 2022 · 1 comment · Fixed by #1829
Closed

index.html fails to be created silently when there is no prefix chapter #1814

ohemelaar opened this issue Jun 2, 2022 · 1 comment · Fixed by #1829

Comments

@ohemelaar
Copy link

ohemelaar commented Jun 2, 2022

When building a book that has no prefix chapter before other titles are defined in SUMMARY.md the index.html file isn't built.

Steps to reproduce:

cd /tmp
mdbook init --ignore git --title 'My Book' my-book
cd my-book
sed -i '3i# Part 1' src/SUMMARY.md
cat src/SUMMARY.md 
# # Summary
# 
# # Part 1
# - [Chapter 1](./chapter_1.md)
mdbook build
ls book/index.html
# ls: cannot access 'book/index.html': No such file or directory

The docs say:

Before the main numbered chapters, prefix chapters can be added...

My understanding is that prefix chapters are thus optional, but mdbook doesn't render correctly without them.

@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 22, 2022

According to the code, the first item in the book is supposed to be rendered a second time as index.html which seems to be undocumented.

My guess as to the cause for this bug is that the first item, if there are no prefix chapters, is the section title. So this should trigger with e.g. a separator as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants