forked from GuillaumeGomez/tuto-rust-fr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-epub2.sh
executable file
·40 lines (35 loc) · 866 Bytes
/
gen-epub2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
(
echo "---"
echo "title: Tutoriel Rust"
echo "author: Guillaume GOMEZ"
echo "lang: fr-FR"
echo "date: `date +%Y`"
echo "cover-image: rust-logo.png"
echo "description: `tail -n +5 README.md`"
echo "---"
echo
echo "# Les bases de la programmation en Rust"
find src/1*md -type f -name '*.md' | \
sort -t _ -k 1.3 -k 2.2 -k 2.1 -n | \
while read l ; do \
tail -n +2 ${l} ; \
echo ; \
done
echo
echo "# Spécificités de Rust"
find src/2*md -type f -name '*.md' | \
sort -t _ -k 1.3 -k 2.2 -k 2.1 -n | \
while read l ; do \
tail -n +2 ${l} ; \
echo ; \
done
echo
echo "# Aller plus loin"
find src/3*md -type f -name '*.md' | \
sort -t _ -k 1.3 -k 2.2 -k 2.1 -n | \
while read l ; do \
tail -n +2 ${l} ; \
echo ; \
done
) | pandoc -f markdown -t epub2 -o tuto-rust.epub