Configuration
This page lists all options for the preprocessor.
For use in book.toml, configure under the [preprocessor.rustdoc-link] table using
the keys below, for example:
[preprocessor.rustdoc-link]
rust-analyzer = "path/to/rust-analyzer --option ..."
For use on the command line, use the keys as long arguments, for example:
mdbook-rustdoc-link markdown --rust-analyzer "..."
| Option | Summary |
|
Directory in which to persist build cache |
|
|
List of features to activate when running rust-analyzer |
|
|
Exit with a non-zero status code when some links fail to resolve |
|
|
Directory from which to search for a Cargo project |
|
|
Command to use for spawning rust-analyzer |
|
|
Timeout in seconds to wait for rust-analyzer to finish indexing |
|
|
Whether to enable punctuations like smart quotes |
cache-dir
Directory in which to persist build cache.
Setting this will enable caching. Will skip rust-analyzer if cache hits.
| Default |
|
|---|---|
| Type |
cargo-features
List of features to activate when running rust-analyzer.
This is just the rust-analyzer.cargo.features config.
In book.toml — to enable all features, use ["all"].
For CLI — to enable multiple features, specify as comma-separated values, or specify multiple times; to enable all features, specify --cargo-features all.
| Default |
|
|---|---|
| Type |
fail-on-warnings
Exit with a non-zero status code when some links fail to resolve.
Warnings are always printed to the console regardless of this option.
| Choice | Description |
"ci"
|
Fail if the environment variable |
"always"
|
Fail as long as there are warnings, even in local use |
| Default |
|
|---|---|
| Type |
manifest-dir
Directory from which to search for a Cargo project.
By default, the current working directory is used. Use this option to specify a different directory.
The processor requires the Cargo.toml of a package to work. If you are working on a Cargo workspace, set this to the relative path to a member crate.
| Default |
|
|---|---|
| Type |
rust-analyzer
Command to use for spawning rust-analyzer.
By default, prebuilt binary from the VS Code extension is tried. If that doesn't exist, it is assumed that rust-analyzer is on PATH. Use this option to override this behavior completely.
The command string will be tokenized by shlex, so you can include arguments in it.
| Default |
|
|---|---|
| Type |
rust-analyzer-timeout
| Default |
|
|---|---|
| Type |
smart-punctuation
Whether to enable punctuations like smart quotes “”.
This is only meaningful if your links happen to have visible text that has specific punctuation. The processor otherwise passes through the rest of your Markdown source untouched.
In book.toml — this option is not needed because output.html.smart-punctuation is honored.
| Default |
|
|---|---|
| Type |