Skip to content

feat(mdbook): allow default configuration - #4207

Merged
UebelAndre merged 6 commits into
bazelbuild:mainfrom
tomatotomata:codex/mdbook-default-config
Sep 16, 2026
Merged

UebelAndre merged 6 commits into
bazelbuild:mainfrom
tomatotomata:codex/mdbook-default-config

Conversation

@tomatotomata

Copy link
Copy Markdown
Contributor

Summary

  • make the book attribute optional for the mdbook rule
  • generate an empty book.toml so mdBook uses its documented default configuration
  • add a build test covering a book with only src/SUMMARY.md and chapter sources

This 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, including src as the source directory. I kept the generated file in the package staging tree so the existing input mapping and mdbook_server provider continue to use the same config path. Let me know what you think.

Validation

  • git diff --check passed
  • inspected mdBook 0.4.44 configuration defaults: an empty TOML file loads src as the source directory
  • Bazel execution was not available in this Windows environment, so the new build target is left for the repository CI matrix

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I had just one question

Comment thread extensions/mdbook/private/mdbook.bzl Outdated
Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>
Comment thread extensions/mdbook/private/mdbook.bzl Outdated
@illicitonion illicitonion added the awaiting-response Maintainers have responded to the pull-request or thread and now await contributor responses. label Sep 2, 2026
@tomatotomata

Copy link
Copy Markdown
Contributor Author

Yes, that makes sense. I removed the provider-specific path and now every staged source, including the generated default config, uses _src_dest_path(file). The focused mdBook tests for default config, simple, stitched, and bzlmod pass on 29948fbcd; the broader external-source build still hits the existing Windows path lookup failure. The updated branch is pushed, so the simpler interface is in place.

@UebelAndre

Copy link
Copy Markdown
Collaborator

This is looking good, once CI passes I'm happy to merge!

@tomatotomata

Copy link
Copy Markdown
Contributor Author

Buildkite and the formatting check are green on 813abe1, and the Google CLA check is green too. I dropped the provider-specific field as you suggested, so the generated default config now goes through the same _src_dest_path() path as the other staged sources. Let me know if anything else looks off.

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@UebelAndre
UebelAndre added this pull request to the merge queue Sep 16, 2026
@UebelAndre UebelAndre removed the awaiting-response Maintainers have responded to the pull-request or thread and now await contributor responses. label Sep 16, 2026
Merged via the queue into bazelbuild:main with commit 5d80db4 Sep 16, 2026
3 checks passed
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.

3 participants