]>
Commit | Line | Data |
---|---|---|
cc61c64b XL |
1 | #!/bin/bash |
2 | # Copyright 2016 The Rust Project Developers. See the COPYRIGHT | |
3 | # file at the top-level directory of this distribution and at | |
4 | # http://rust-lang.org/COPYRIGHT. | |
5 | # | |
6 | # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
7 | # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
8 | # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
9 | # option. This file may not be copied, modified, or distributed | |
10 | # except according to those terms. | |
11 | ||
12 | set -eu | |
13 | ||
14 | cargo build --release | |
15 | ||
16 | mkdir -p tmp | |
17 | rm -rf tmp/*.md | |
18 | ||
19 | # Get all the markdown files in the src dir, | |
abe05a73 | 20 | ls src/${1:-""}*.md | \ |
cc61c64b XL |
21 | # except for SUMMARY.md. |
22 | grep -v SUMMARY.md | \ | |
23 | # Extract just the filename so we can reuse it easily. | |
24 | xargs -n 1 basename | \ | |
25 | # Remove all links followed by <!-- ignore -->, then | |
26 | # Change all remaining links from markdown to italicized inline text. | |
27 | while IFS= read -r filename; do | |
abe05a73 XL |
28 | < "src/$filename" ./target/release/remove_links \ |
29 | | ./target/release/link2print \ | |
30 | | ./target/release/remove_markup > "tmp/$filename" | |
cc61c64b XL |
31 | done |
32 | # Concat the files into the nostarch dir. | |
abe05a73 | 33 | ./target/release/concat_chapters tmp nostarch |