-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_manuals
executable file
·63 lines (48 loc) · 3.27 KB
/
build_manuals
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# cp XXquickemu.1-14-AllquickemuOptions-02coggged.md quickemu.1-14-AllquickemuOptions-02coggged.md
../quickget list_csv | awk -F"," '{print "* `" $2 "` ("$1")" }' |grep -e buntu |sort -u >quickemu.1-07-Ubuntus02-generated.md
../quickget list_csv | awk -F"," '{print "* `" $2 "` ("$1")" }' |grep -v -e 'Display Name' -e windows -e macos -e buntu |sort -u >quickemu.1-08-OtherOperatingSystems02-generated.md
echo quickemu.1-* > quickemu.lst
echo quickget.1-00-header.md quickemu.1-0[7-9]* quickemu.1-1[0-3]* quickget.1-09-footer.md > quickget.lst
## Significantly reduces weight in Readme
# echo quickemu.1-0[4-5]* README-06-Install.md quickemu.1-0[6-9]* \
# quickemu.1-1[0-3]* quickemu_conf.1-01-spiceheadless.md README-135-accessibility.md README-135-confoptions.md quickemu.1-1[4-9]* quickemu.1-2*
echo README-0[1-5]* > README.lst
#
echo quickemu_conf.1-00-hdr.md README-135-confoptions.md quickemu_conf.1-05-footer.md > quickemu_conf.lst
# update date front-matter
sed -i "s/^date: .*/date: $(date +'%B %e, %Y')/" \
quickemu.1-01-head.md \
quickemu_conf.1-00-hdr.md \
quickget.1-00-header.md
## strip the cog for docs and manuals
#cog has to run using the right quickemu
ln -sf ../quickemu ../quickget .
cog -e -d -o quickemu.1-08-OtherOperatingSystems01.md XXquickemu.1-08-OtherOperatingSystems01.md
cog -e -d -o quickemu.1-14-AllquickemuOptions-02coggged.md XXquickemu.1-14-AllquickemuOptions-02coggged.md
#pandoc options to match wimpy's markdown style preferences
# shellcheck disable=SC2046
pandoc --wrap=preserve --columns=120 -s $(cat README.lst) -f markdown-smart -t gfm > README_main.md
#| sed 's/`<kbd>`{=html}/<kbd>/; s/`<\/kbd>`{=html}/<\/kbd>/; s/```{=html}//' > README_main.md
# the above no longer needed as pandoc now handles kbd and code blocks correctly if output is gfm
#
cat README-00-hdr.md README_main.md >../README.md
# ( cd .. ; cog -r README.md )
# readme no longer has dynamic content
# pandoc -s $(cat quickemu_conf.lst) -f markdown -t markdown | sed 's/`<kbd>`{=html}/<kbd>/; s/`<\/kbd>`{=html}/<\/kbd>/; s/```{=html}//' > ../docs/quickemu_conf.1.md
# pandoc -s $(cat quickemu.lst) -f markdown -t markdown | sed 's/`<kbd>`{=html}/<kbd>/; s/`<\/kbd>`{=html}/<\/kbd>/; s/```{=html}//' > ../docs/quickemu.1.md
# pandoc -s $(cat quickget.lst) -f markdown -t markdown | sed 's/`<kbd>`{=html}/<kbd>/; s/`<\/kbd>`{=html}/<\/kbd>/; s/```{=html}//' > ../docs/quickget.1.md
# #
# pandoc -s ../docs/quickemu.1.md -f markdown -t man -o ../docs/quickemu.1
# pandoc -s ../docs/quickget.1.md -f markdown -t man -o ../docs/quickget.1
# pandoc -s ../docs/quickemu_conf.1.md -f markdown -t man -o ../docs/quickemu_conf.1
# shellcheck disable=SC2046
pandoc -s $(cat quickemu_conf.lst) -f markdown-smart -t gfm+definition_lists > ../docs/quickemu_conf.5.md
# shellcheck disable=SC2046
pandoc -s $(cat quickemu.lst) -f markdown-smart -t gfm+definition_lists > ../docs/quickemu.1.md
# shellcheck disable=SC2046
pandoc -s $(cat quickget.lst) -f markdown-smart -t gfm+definition_lists > ../docs/quickget.1.md
#
pandoc -s ../docs/quickemu.1.md -f gfm+definition_lists -t man -o ../docs/quickemu.1
pandoc -s ../docs/quickget.1.md -f gfm+definition_lists -t man -o ../docs/quickget.1
pandoc -s ../docs/quickemu_conf.5.md -f gfm+definition_lists -t man -o ../docs/quickemu_conf.5