Add --backend
argument for mdbook build
command to build the specific backend
#2648
Labels
C-enhancement
Category: Enhancement or feature request
Problem
According to the documentation in mdBook:
Taking the rustc-dev-guide as an example. Since it specifies both html and linkcheck backends in
book.toml
, running themdbook build
command generates a directory structure like this:However, I don't want this behavior. I want to generate only the HTML output directly in the
book/
directory (without subdirectories likebook/html/
), even when multiple backends are specified inbook.toml
.Proposed Solution
Provide
--backend <backend>
argument formdbook build
command:--backend
isall
, which will use all backends specified inbook.toml
.--backend html
), only that backend will generate output.For example:
The above command will generate
.html
documents directly to./book
directory even if there are multiple backends specified inbook.toml
. The directory structure should be like this:Notes
Let's take a look at Sphinx, which provides two arguments for specifying builders (
-M
and-b
):-M <buildername>
: Outputs files in<outputdir>/<buildername>
directory.-b <buildername>
: Outputs files directly in<outputdir>
directory.What I want is equivalent to the
-b
behavior—generating files directly in<outputdir>
without subdirectories.The text was updated successfully, but these errors were encountered: