Skip to content

Rendered Rust Book example #121

Answered by max-heller
afranke asked this question in Q&A
Dec 29, 2024 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Hi Alexandre, the sample books are rendered by #[test]s in lib.rs -- in particular, this one for the Rust book:

mdbook-pandoc/src/lib.rs

Lines 1596 to 1607 in 24b1beb

#[test]
#[ignore]
fn rust_book() {
let logs = MDBook::load(BOOKS.join("rust-book"))
.config(Config {
hosted_html: Some("https://doc.rust-lang.org/book/".into()),
..Config::pdf()
})
.build()
.logs;
insta::assert_snapshot!(logs);
}

Config::pdf() mainly just configures fonts and page margins, which may be what makes it not look very "LaTeX-y":

mdbook-pandoc/src/lib.rs

Lines 512 to 540 in 24b1beb

fn pdf() -> Self {
toml! {
keep-preproc…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@afranke
Comment options

Answer selected by afranke
Comment options

You must be logged in to vote
1 reply
@afranke
Comment options

Comment options

You must be logged in to vote
1 reply
@max-heller
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants