mirror of
https://github.com/rust-lang/book.git
synced 2026-05-16 23:10:40 -04:00
Building on the shared infra from `mdbook_trpl`, this preprocessor takes
nicely accessible and semantic HTML input like this:
<figure>
<img src="https://www.example.com/something.jpg">
<figcaption>Figure 12-34: An illustration of something</figcaption>
</figure>
It produces output like this:
<img src="https://www.example.com/something.jpg">
Figure 12-34: An illustration of something
This matches what we need for the nostarch output. Accordingly, wire up
the `nostarch/book.toml` to use this. There is no need to worry about
ordering of the two preprocessors, because in `Simple` mode the listing
preprocessor emits plain text output for listings (much as this does for
figures).
24 lines
738 B
TOML
24 lines
738 B
TOML
[book]
|
|
title = "The Rust Programming Language"
|
|
authors = ["Steve Klabnik", "Carol Nichols", "Chris Krycho", "Contributions from the Rust Community"]
|
|
src = "../src" # needs to be explicit (it is implicit in `/book.toml`).
|
|
|
|
[output.html]
|
|
additional-css = ["../ferris.css", "../theme/2018-edition.css", "../theme/semantic-notes.css"]
|
|
additional-js = ["../ferris.js"]
|
|
git-repository-url = "https://github.com/rust-lang/book"
|
|
|
|
[build]
|
|
build-dir = "../tmp"
|
|
|
|
[preprocessor.trpl-listing]
|
|
output-mode = "simple"
|
|
|
|
# Only used in this version, *not* in the root `book.toml`, because its job is
|
|
# to remove `<figure>` and `<figcaption>` markup from the version we send them.
|
|
[preprocessor.trpl-figure]
|
|
output-mode = "simple"
|
|
|
|
[rust]
|
|
edition = "2021"
|