Skip to content

Allow mdbook rule to use default configuration without requiring book.toml #4194

Description

@qhai-dev

Currently, the mdbook rule requires users to provide a book attribute pointing to a book.toml file.

For example:

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:

mdbook(
    name = "doc_book",
    srcs = [
        "//doc",
    ],
)

should work without requiring users to create an empty book.toml.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    mdbookIssues related to MdBook rules

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions