-
Notifications
You must be signed in to change notification settings - Fork 12
/
mkslides
executable file
·42 lines (38 loc) · 1.35 KB
/
mkslides
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
41
#
# mkslides, 7 Mar 16
base_file=`basename $1 .txt`
sed -e "s/<equ>/latexmath:[$/g" \
-e "s/<\/equ>/$]/g" \
-e "s/<EQU>/latexmath:[$\\\\begin{aligned}/g" \
-e "s/<\/EQU>/\\\\end{aligned}$]/g" \
-e "s/<keyword>/++/g" \
-e "s/<\/keyword>/++/g" \
-e "s/<code>/++pass:[/g" \
-e "s/<\/code>/]++/g" \
-e "s/<rcode>/++pass:[/g" \
-e "s/<\/rcode>/]++/g" \
-e "s/<roption>/++pass:[/g" \
-e "s/<\/roption>/]++/g" \
-e "s/<routput>/++pass:[/g" \
-e "s/<\/routput>/]++/g" \
-e "s/<file>/++pass:[/g" \
-e "s/<\/file>/]++/g" \
-e "s/<command>/++pass:[/g" \
-e "s/<\/command>/]++/g" \
-e "s/<phrase>/_/g" \
-e "s/<\/phrase>/_/g" \
-e "s/<quote>/\`/g" \
-e "s/<\/quote>/\'/g" \
-e "s/javaident\[\([^]]\+\)\]/++\1++/g" \
-e "s/program\[\([^]]\+\)\]/++\1++/g" \
-e "s/squote\[\([^]]\+\)\]/pass:[\'\1\']/g" \
-e "s/C++/\&CCPP;/g" \
-e "s/\\\\\([a-zA-Z]\){\([a-zA-Z]\)}/LletBlet\1\2/g" \
-e "s/{\\\\\([a-zA-Z][a-zA-Z]\)}/Lletlet\1/g" \
-e "s/{\\\\'\([a-zA-Z]\)}/Laccup\1/g" \
-e "s/{\\\\\"\([a-zA-Z]\)}/Ldotdot\1/g" \
-e "s/{\\\\o}/\&Loslash;/g" \
-e "s/{\\\\O}/\&LOslash;/g" \
$1 | asciidoc -a latexmath --backend slidy $2 $3 $4 $5 $6 $7 $8 $9 - | \
# A $ on its own in code does not appear, so map to \$
sed -e "s/#990000\">\\$/#990000\">\\\\$/g" > "$base_file".html