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