]> git.proxmox.com Git - rustc.git/blob - src/doc/book/second-edition/nostarch.sh
New upstream version 1.34.2+dfsg1
[rustc.git] / src / doc / book / second-edition / nostarch.sh
1 #!/bin/bash
2
3 set -eu
4
5 cargo build --release
6
7 mkdir -p tmp
8 rm -rf tmp/*.md
9
10 # Get all the Markdown files in the src dir,
11 ls src/${1:-""}*.md | \
12 # except for `SUMMARY.md`.
13 grep -v SUMMARY.md | \
14 # Extract just the filename so we can reuse it easily.
15 xargs -n 1 basename | \
16 # Remove all links followed by `<!-- ignore -->``, then
17 # Change all remaining links from Markdown to italicized inline text.
18 while IFS= read -r filename; do
19 < "src/$filename" ./target/release/remove_links \
20 | ./target/release/link2print \
21 | ./target/release/remove_markup > "tmp/$filename"
22 done
23 # Concatenate the files into the `nostarch` dir.
24 ./target/release/concat_chapters tmp nostarch