forked from rust-lang/book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script that hooks the nostarch build commands together
- Loading branch information
1 parent
2d3651d
commit 117bb1d
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ book/ | |
.idea | ||
.DS_Store | ||
target | ||
tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
mkdir -p tmp | ||
|
||
# Get all the markdown files in the src dir, | ||
ls src/*.md | \ | ||
# except for SUMMARY.md. | ||
grep -v SUMMARY.md | \ | ||
# Extract just the filename so we can reuse it easily. | ||
xargs -n 1 basename | \ | ||
# Change all the links from markdown to italicized inline text. | ||
while IFS= read -r filename; do | ||
cargo run --bin link2print < "src/$filename" > "tmp/$filename" | ||
done | ||
# Concat the files into the nostarch dir. | ||
cargo run --bin concat_chapters tmp nostarch |