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
|
#!/bin/sh
# Generate help.h from README.adoc
set -e
infile="$1"
outfile="$2"
tmpfile1="$2.t1"
tmpfile2="$2.t2"
asciidoc --attribute 'newline=\n' --backend=html4 --no-header-footer \
--out-file="$tmpfile1" "$infile"
sed -n -e 's/"/\\"/g' -e '/Command line arguments/,$s/^.*$/"&\\n"/p' \
"$tmpfile1" >"$tmpfile2"
cat >"$outfile" <<EOF
/* Help content is generated automatically from README.adoc by helpgen script */
static const char* helpInfo =
"<qt>\n"
"<center><h1>QGit Handbook</h1></center>\n"
`cat "$tmpfile2"`
"</qt>\n";
EOF
rm -f "$tmpfile1" "$tmpfile2"
|