]>
Commit | Line | Data |
---|---|---|
cc61c64b | 1 | #!/bin/bash |
cc61c64b XL |
2 | |
3 | set -eu | |
4 | ||
5 | cargo build --release | |
6 | ||
7 | mkdir -p tmp | |
8 | rm -rf tmp/*.md | |
9 | ||
9fa01778 | 10 | # Get all the Markdown files in the src dir, |
abe05a73 | 11 | ls src/${1:-""}*.md | \ |
9fa01778 | 12 | # except for `SUMMARY.md`. |
cc61c64b XL |
13 | grep -v SUMMARY.md | \ |
14 | # Extract just the filename so we can reuse it easily. | |
15 | xargs -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 | 18 | while 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 | 22 | done |
9fa01778 | 23 | # Concatenate the files into the `nostarch` dir. |
abe05a73 | 24 | ./target/release/concat_chapters tmp nostarch |