bazelbuild / bazelbuild/rules_rust
Allow mdbook rule to use default configuration without requiring book.toml
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Currently, the `mdbook` rule requires users to provide a `book` attribute pointing to a `book.toml` file.
For example:
```python
mdbook(
name = "doc_book",
srcs = [
"//doc",
],
book = "//:book.toml",
)
```
However, there are cases where users do not need any custom mdBook configuration. In these scenarios, users have to create an empty book.toml file only to satisfy the rule requirement.
For simple documentation projects, this adds an unnecessary file and extra setup. Users should be able to use the default mdBook behavior without creating a configuration file that contains no custom settings.
Describe the solution you'd like
Make the book attribute optional.
If the book attribute is not provided, the rule could generate a default configuration internally or use mdBook's default behavior.
For example:
```python
mdbook(
name = "doc_book",
srcs = [
"//doc",
],
)
```
should work without requiring users to create an empty book.toml.
Contributor guide
Research direction
Locate the mdBook rule implementation and inspect how the required book attribute is handled. Verify that a simple mdbook target without book.toml works using default mdBook behavior, and add or update coverage for the configuration-free example.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100