feat(mdbook): allow default configuration - #4207
Conversation
UebelAndre
left a comment
There was a problem hiding this comment.
Thanks! I had just one question
| doc = "Information about a `mdbook` target.", | ||
| fields = { | ||
| "config": "File: The `book.toml` file.", | ||
| "config_dest": "String: The path of the configuration file in the staged book.", |
There was a problem hiding this comment.
Do we need this added to the provider? Is it not inferred by config still? The only difference (which one could consider an existing bug) is if config was ever generated the dirname call would be wrong, right? If that's the case I would make a heuristic on owner or short_path to get the right location.
There was a problem hiding this comment.
I was thinking about this too. For an explicitly supplied book.toml, config is enough and _src_dest_path(book_info.config) matches the existing staged path. The generated default is different: its declared output short_path is under Bazel output, so deriving the server --config path from config would point outside the staged book directory. The provider config_dest keeps both cases explicit and avoids an owner/short_path heuristic. I also pushed 95bbe23 to match buildifier formatting for the doc string. Let me know what you think about keeping the provider field for that generated-file case.
Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>
Summary
bookattribute optional for themdbookrulebook.tomlso mdBook uses its documented default configurationsrc/SUMMARY.mdand chapter sourcesThis addresses #4194. The issue discussion asked for a PR that demonstrates mdBook can run without a user-provided
book.toml; an empty configuration parses to mdBook's defaults, includingsrcas the source directory. I kept the generated file in the package staging tree so the existing input mapping andmdbook_serverprovider continue to use the same config path. Let me know what you think.Validation
git diff --checkpassedsrcas the source directory