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"
23 # Concatenate the files into the `nostarch` dir.
24 .
/target
/release
/concat_chapters tmp nostarch