-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-ConfigurationArea: ConfigurationArea: ConfigurationC-bugCategory: A bug, incorrect or unintended behaviorCategory: A bug, incorrect or unintended behavior
Description
Problem
Currently if there is an error in the HTML config, mdbook prints an error, but does not fail the build.
Steps
Create a book.toml with an invalid HTML config:
[book]
title = "foo"
[output.html]
foo = 123With the current output:
INFO Book building has started
INFO Running the html backend
ERROR Failed to deserialize `output.html`
Caused by: unknown field `foo`, expected one of `theme`, `default-theme`, `preferred-dark-theme`, `smart-punctuation`, `definition-lists`, `admonitions`, `mathjax-support`, `additional-css`, `additional-js`, `fold`, `playground`, `playpen`, `code`, `print`, `no-section-label`, `search`, `git-repository-url`, `git-repository-icon`, `input-404`, `site-url`, `cname`, `edit-url-template`, `live-reload-endpoint`, `redirect`, `hash-files`, `sidebar-header-nav`
INFO HTML book written to `/Users/eric/Temp/foo/book`
Possible Solution(s)
I think the solution should be to change Config.html_config to return a Result. This can be a little awkward in some places, but I think is probably the best solution. Since this is an "internal" function (doc-hidden), I think it should be OK to make a breaking change to it.
Notes
No response
Version
mdbook v0.5.1
Metadata
Metadata
Assignees
Labels
A-ConfigurationArea: ConfigurationArea: ConfigurationC-bugCategory: A bug, incorrect or unintended behaviorCategory: A bug, incorrect or unintended behavior