rules_rust_mdbook
Bazel rules for mdBook.
Rules
Setup
bzlmod
bazel_dep(name = "rules_rust_mdbook", version = "{SEE_RELEASE_NOTES}")
WORKSPACE
load("@rules_rust_mdbook//:repositories.bzl", "mdbook_register_toolchains", "rules_mdbook_dependencies")
rules_mdbook_dependencies()
mdbook_register_toolchains()
load("@rules_rust_mdbook//:repositories_transitive.bzl", "rules_mdbook_transitive_deps")
rules_mdbook_transitive_deps()
mdbook
load("@rules_rust_mdbook//:defs.bzl", "mdbook") mdbook(name, srcs, book, plugins)
Rules to create book from markdown files using mdBook
.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | All inputs to the book. | List of labels | optional | [] |
book | The book.toml file. | Label | required | |
plugins | Executables to inject into PATH for use in preprocessor commands. | List of labels | optional | [] |
mdbook_server
load("@rules_rust_mdbook//:defs.bzl", "mdbook_server") mdbook_server(name, book, hostname, port)
Spawn an mdbook server for a given mdbook
target.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
book | The mdbook target to serve. | Label | required | |
hostname | The default hostname to use (Can be overridden on the command line). | String | optional | "localhost" |
port | The default port to use (Can be overridden on the command line). | String | optional | "3000" |
mdbook_toolchain
load("@rules_rust_mdbook//:defs.bzl", "mdbook_toolchain") mdbook_toolchain(name, mdbook, plugins)
A mdBook toolchain.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
mdbook | A mdBook binary. | Label | required | |
plugins | Executables to inject into PATH for use in preprocessor commands. | List of labels | optional | [] |