added a `make clean` target refentry-agama.css is my stupid attempt to do minimal styling Makefile has a quirky syntax that is a barrier to maintenance; separate shell scripts are an easy target for shellcheck too.
36 lines
789 B
Bash
Executable file
36 lines
789 B
Bash
Executable file
#!/bin/sh
|
|
# Build HTML for GitHub pages
|
|
set -eu
|
|
|
|
# Workflow:
|
|
# gdbus-codegen (glib2-devel.rpm)
|
|
# - reads *.doc.xml introspection with comments
|
|
# - writes ref-*.xml, DocBook refentry pieces
|
|
# xmlto
|
|
# - reads ref-*.xml
|
|
# - writes *.html
|
|
|
|
# TODO opt in for a repo-wide shellcheck
|
|
|
|
# TODO help message
|
|
distdir=$1
|
|
tmpdir=$2
|
|
mkdir -p "$distdir" "$tmpdir"
|
|
|
|
for f in org.opensuse.Agama*.doc.xml; do
|
|
echo "$f"
|
|
gdbus-codegen \
|
|
--interface-prefix=org.opensuse.Agama. \
|
|
--output-directory="$tmpdir" \
|
|
--generate-docbook=ref \
|
|
"$f"
|
|
docbook="$tmpdir/ref-${f%.doc.xml}.xml"
|
|
xmlto \
|
|
-o "$distdir" \
|
|
--skip-validation \
|
|
--stringparam html.stylesheet=refentry-agama.css \
|
|
html-nochunks \
|
|
"$docbook"
|
|
done
|
|
./make-index > "$distdir"/index.html
|
|
cp refentry-agama.css "$distdir"
|