mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-22 23:10:20 +08:00
Add a script that hooks the nostarch build commands together
This commit is contained in:
parent
2d3651da52
commit
117bb1d2cf
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@ book/
|
|||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
target
|
target
|
||||||
|
tmp
|
||||||
|
|
||||||
|
18
nostarch.sh
Executable file
18
nostarch.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user