Missing snippets in The Rust Programming Language book

218 views Asked by At

I'm trying to download The Rust Programming Language book in epub format using the mdbook-epub tool, but the output file doesn't contain any code snippets. Instead it has placeholders like this:

{{#include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:io}}

Some of those placeholders use rustdoc_include.

How can I generate a file with the embedded snippets?

1

There are 1 answers

0
alf On

I was using a mismatching version of mdbook. This solves the problem:

cargo install mdbook-epub -v 0.3.0
cargo install mdbook --version 0.3.7

For completeness, the book can then be generated by editing book.toml and adding the [output.epub] line at the end. Then mdbook build generates the epub file at book/epub/The Rust Programming Language.epub.