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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
srcsAll inputs to the book.List of labelsoptional[]
bookThe book.toml file.Labelrequired
pluginsExecutables to inject into PATH for use in preprocessor commands.List of labelsoptional[]

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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
bookThe mdbook target to serve.Labelrequired
hostnameThe default hostname to use (Can be overridden on the command line).Stringoptional"localhost"
portThe default port to use (Can be overridden on the command line).Stringoptional"3000"

mdbook_toolchain

load("@rules_rust_mdbook//:defs.bzl", "mdbook_toolchain")

mdbook_toolchain(name, mdbook, plugins)

A mdBook toolchain.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
mdbookA mdBook binary.Labelrequired
pluginsExecutables to inject into PATH for use in preprocessor commands.List of labelsoptional[]