-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
If SUMMARY.md doesn't contain a file, mdbook doesn't give an error #540
Comments
This behaviour is actually configurable by adding a It's kinda hard to figure out a sane default here because it's also a super useful feature when you are initially prototyping a book. You can just write out your I remember having a discussion with @azerupi over whether we should keep it or not, and he had a pretty compelling argument about why |
yeah, i actually enjoy this feature a lot to start.
…On Sat, Jan 13, 2018 at 8:46 AM, Michael Bryan ***@***.***> wrote:
This behaviour is actually configurable by adding a build.create-missing
item to your book.toml, with the option defaulting to true.
It's kinda hard to figure out a sane default here because it's also a
super useful feature when you are initially prototyping a book. You can
just write out your SUMMARY.md with mdbook watch running in the
background and it'll generate everything for you. That said, if you don't
know about the feature then I guess it can feel quite magical.
I remember having a discussion with @azerupi <https://github.com/azerupi>
over whether we should keep it or not, and he had a pretty compelling
argument about why create-missing is a good thing to have.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABsit7-zUGJOliLxKlw6Bzs5fntWUhnks5tKLOmgaJpZM4RdOY_>
.
|
Interesting @Michael-F-Bryan. I see how this feature can be useful for prototyping. I guess if you both want it kept I guess we shouldn't change defaults any more... I don't use this tool at all so you know best what is most convenient :). It would be great if Rust's CI could somehow enable this strict mode however to be able to detect bugs earlier. I see two ways:
The first option would mean that you'd always have to flip the option when you want the prototyping mode. It would also make it harder to keep track whether the feature is enabled for all affected books... someone would have to check that this flag is set for new books and if someone flips it locally for better development but doesnt flip it back it might slip under the radar. Maybe a tidy lint could do it but generally I think I prefer the second option. @steveklabnik how does the doc team commonly invoke mdbook for the books? Do you use x.py? Or do you rather use mdbook directly? If you use x.py there might be a disadvantage of the second option, as disabling the flag locally is harder (you need to patch bootstrap). But I guess I'm overthinking this issue a bit :p. |
We never create new books via |
A third option would be to enable it via an environment variable. That should help with both the CI case and if you use I believe there's even an old PR which allowed you to override configuration using environment variables, but the config system back then wasn't nearly as easy to use so the PR never got finished. |
Env var or command line flag, both would be fine. |
Suppose you changed a line in SUMMARY.md of the example book from:
- [watch](cli/watch.md)
to
- [watch](cli/wa_tch.md)
The file
wa_tch.md
doesn't exist. If you ask mdbook to create the book, it doesn't give you any error or complaint that the file couldn't be found. Instead it generates an empty page. This has led to an issue with Rust's documentation staying undiscovered: rust-lang/rust#47394 .Therefore mdbook should fail generation of the book if it encounters a file it can't find.
The text was updated successfully, but these errors were encountered: