-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-generator.sh
executable file
·32 lines (24 loc) · 1.09 KB
/
html-generator.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
#!/bin/bash
####
# Script to search for all branches with documentation
####
# Clean up to start with new files
rm -f content{,html,pdf,man,-manpages}
# find all directories and call html-gen2.sh for each of them
# Filtering for unwanted dirs occurs in the script called
find . -maxdepth 1 -type d -exec ./html-gen2.sh {} \;
# echo Now change the result for html and pdf links
sed s/FORMATDEFINITION/html/g content > contenthtml
sed s\!FORMATDEFINITION\!latex/refman.pdf\!g content | sed s/_blank/_self/g > contentpdf
sed s\!FORMATDEFINITION\!ckb-next-man.tar.gz\!g content-manpages | sed s/_blank/_self/g > contentman
# echo replace the searchstring with the new content
awk 'NR==FNR { a[n++]=$0; next }
/PUT_SECTION_HERE/ { for (i=0;i<n;++i) print a[i]; next }
1' contenthtml pres-html.html.input > pres-html.html
awk 'NR==FNR { a[n++]=$0; next }
/PUT_SECTION_HERE/ { for (i=0;i<n;++i) print a[i]; next }
1' contentpdf pres-pdf.html.input > pres-pdf.html
awk 'NR==FNR { a[n++]=$0; next }
/PUT_SECTION_HERE/ { for (i=0;i<n;++i) print a[i]; next }
1' contentman pres-man.html.input > pres-man.html
exit 0