File: doc.sh

package info (click to toggle)
postgresql-pllua 1%3A2.0.10-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,316 kB
  • sloc: ansic: 14,369; sql: 2,181; makefile: 163; sh: 59; javascript: 38
file content (31 lines) | stat: -rwxr-xr-x 513 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

printf "<html><head>\n"

for fn; do
    case "$fn" in
		*.css)	printf '<style id="%s">\n' "${fn##*/}";
				cat -- "$fn";
				printf "</style>\n";;
		*.js)	printf '<script id="%s" type="text/javascript">\n' "${fn##*/}";
				cat -- "$fn";
				printf "</script>\n";;
		*.meta) cat -- "$fn";;
    esac
done

printf "</head><body>\n"

for fn; do
    shift
    case "$fn" in
		*.md)	set -- "$@" "$fn";;
		*.html)	cat -- "$fn";;
    esac
done

cmark --unsafe "$@" || exit 1

printf "</body></html>\n"

exit 0