Skip to content

Instantly share code, notes, and snippets.

@Lifto
Created January 12, 2026 18:35
Show Gist options
  • Select an option

  • Save Lifto/73d3cf4bfc22ac4d9e493ac44fe97402 to your computer and use it in GitHub Desktop.

Select an option

Save Lifto/73d3cf4bfc22ac4d9e493ac44fe97402 to your computer and use it in GitHub Desktop.
Place in quick-docs repo and run it, creates an adjacent quick-docs-html directory with the .adoc files rendered to .html
OUT_DIR="$PWD/../quick-docs-html"
mkdir -p "$OUT_DIR"
podman run --rm \
-v "$PWD:/work:Z" \
-v "$OUT_DIR:/out:Z" \
-w /work \
docker.io/asciidoctor/docker-asciidoctor \
bash -lc '
set -u
ok=0
fail=0
while IFS= read -r -d "" f; do
rel="${f#./}"
out="/out/${rel%.adoc}.html"
mkdir -p "$(dirname "$out")"
echo "Converting: $rel"
if asciidoctor -o "$out" "$rel"; then
ok=$((ok+1))
else
echo "FAILED: $rel" >&2
fail=$((fail+1))
fi
done < <(find modules -type f -path "*/pages/*.adoc" -print0)
echo
echo "Done. OK=$ok FAIL=$fail"
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment