mirror of
https://github.com/rust-lang/book.git
synced 2026-04-04 21:48:17 -04:00
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-051 This also changes it so that it is not necessary to install `mbdook-trpl`. This should make it easier to work with the book and the extension.
31 lines
953 B
Bash
Executable File
31 lines
953 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
cargo build --release
|
|
|
|
mkdir -p tmp
|
|
rm -rf tmp/*.md
|
|
rm -rf tmp/markdown
|
|
|
|
# Render the book as Markdown to include all the code listings
|
|
MDBOOK_OUTPUT__MARKDOWN='{}' mdbook build nostarch
|
|
|
|
# Get all the Markdown files
|
|
# TODO: what was this doing and why?!?
|
|
# find tmp/markdown -name "${1:-\"\"}*.md" -print0 | \
|
|
find tmp/markdown -name "*.md" -print0 | \
|
|
# Extract just the filename so we can reuse it easily.
|
|
xargs -0 basename | \
|
|
# Remove all links followed by `<!-- ignore -->``, then
|
|
# Change all remaining links from Markdown to italicized inline text.
|
|
while IFS= read -r filename; do
|
|
< "tmp/markdown/$filename" ./target/release/remove_links \
|
|
| ./target/release/link2print \
|
|
| ./target/release/remove_markup \
|
|
| ./target/release/remove_hidden_lines \
|
|
| ./target/release/cleanup_blockquotes > "tmp/$filename"
|
|
done
|
|
# Concatenate the files into the `nostarch` dir.
|
|
./target/release/concat_chapters tmp nostarch
|