blob: 0b96cdbc8b2101eac46c4d727f0c763c2179da57 (
plain) (
blame)
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
|
#!/bin/bash
set -eu
targetfile="$(realpath -- build/iadocs/source.gen)"
printf '\n' > "$targetfile"
printfile() {
lang="$1"
tabsize="$2"
base="$3"
shift 3
for i in "$@"
do
printf '\\section{%s}\n' "$(sed 's/_/\\_/g' <<< "$i")" >> "$targetfile"
printf '\\inputminted[breaklines, tabsize=%s]{%s}{%s/%s}\n' "$tabsize" "$lang" "$base" "$i" >> "$targetfile"
done
}
printf '\\chapter{Backend source code}\n' >> "$targetfile"
printfile go 8 ./ *.go
printfile text 8 ./ go.*
printf '\\chapter{Frontend source code}\n' >> "$targetfile"
cd frontend
printfile javascript 4 ./frontend *.js
printfile css 8 ./frontend *.css
printf '\\chapter{HTML templates}\n' >> "$targetfile"
cd ../templates
printfile html 2 ./templates *.html
printf '\\chapter{Build system and auxiliary scripts}\n' >> "$targetfile"
cd ..
printfile makefile 8 ./ Makefile
cd scripts
printfile bash 8 ./scripts *.sh
printf '\\chapter{SQL scripts}\n' >> "$targetfile"
cd ../sql
printfile postgresql 8 ./sql *.sql
printf '\\chapter{Production documentation}\n' >> "$targetfile"
cd ../docs
printfile html 2 ./docs *.html
printfile css 8 ./docs *.css
printfile text 8 ./docs *.csv cca.scfg.example
|