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

Enable MDBOOK_BOOK to overwrite book.toml #1207

Merged
merged 5 commits into from
May 8, 2020
Merged

Enable MDBOOK_BOOK to overwrite book.toml #1207

merged 5 commits into from
May 8, 2020

Conversation

toyboot4e
Copy link
Contributor

@toyboot4e toyboot4e commented May 3, 2020

Config::update_from_env says:

/// > This means, if you so desired, you could override all book metadata
/// > when building the book with something like
/// >
/// > ```text
/// > $ export MDBOOK_BOOK="{'title': 'My Awesome Book', authors: ['Michael-F-Bryan']}"
/// > $ mdbook build
/// > ```

This is wrong in two ways:

  1. We can't overwrite book.toml with MDBOOK_BOOK
  2. The example value of MDBOOK_BOOK is a invalid JSON string (missing/unproper quotes)

So I fixed them so that the example works. But I didn't add any automated test.

src/config.rs Outdated Show resolved Hide resolved
Co-authored-by: Eric Huss <[email protected]>
@toyboot4e
Copy link
Contributor Author

Thank you very much for your review!

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss merged commit 07dfc4b into rust-lang:master May 8, 2020
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
Enable `MDBOOK_BOOK`  to overwrite `book.toml`
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 this pull request may close these issues.

2 participants