Skip to content

Commit 78aa2a1

Browse files
committed
Mention that uninstalled backend isn't marked optional.
If an uninstalled backend (command not found) isn't marked optional, warn about it, since it causes mdbook commands to error out. Fixes #1283
1 parent 303db0d commit 78aa2a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

book-example/src/for_developers/backends.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ the usual `RUST_LOG` to control logging verbosity.
334334
If you enable a backend that isn't installed, the default behavior is to throw an error:
335335

336336
```text
337-
The command wasn't found, is the "wordcount" backend installed?
337+
The command `mdbook-wordcount` wasn't found, is the "wordcount" backend installed?
338+
If you want to ignore this error when the "wordcount" backend is not installed,
339+
set `optional = true` in the `[output.wordcount]` section of the book.toml configuration file.
338340
```
339341

340342
This behavior can be changed by marking the backend as optional.

src/renderer/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ impl CmdRenderer {
173173
return Ok(());
174174
} else {
175175
error!(
176-
"The command `{}` wasn't found, is the `{}` backend installed?",
176+
"The command `{0}` wasn't found, is the \"{1}\" backend installed? \
177+
If you want to ignore this error when the \"{1}\" backend is not installed, \
178+
set `optional = true` in the `[output.{1}]` section of the book.toml configuration file.",
177179
self.cmd, self.name
178180
);
179181
}

0 commit comments

Comments
 (0)