build: add PDF generation step (xml2rfc --pdf with weasyprint fallback)
This commit is contained in:
19
build.sh
19
build.sh
@@ -43,8 +43,27 @@ echo "Generating text output..."
|
|||||||
echo "Generating HTML output..."
|
echo "Generating HTML output..."
|
||||||
"$XML2RFC" "$DIR/$DRAFT.xml" --html --quiet 2>/dev/null
|
"$XML2RFC" "$DIR/$DRAFT.xml" --html --quiet 2>/dev/null
|
||||||
|
|
||||||
|
# Step 4: XML -> PDF (requires weasyprint + pangocffi + pycairo injected into xml2rfc venv
|
||||||
|
# and pydyf<0.10 pinned; see /home/c/projects/research.ietf/workspace/drafts/README-pdf.md)
|
||||||
|
echo "Generating PDF output..."
|
||||||
|
if "$XML2RFC" "$DIR/$DRAFT.xml" --pdf --quiet 2>/dev/null; then
|
||||||
|
PDF_OK=1
|
||||||
|
else
|
||||||
|
echo " xml2rfc --pdf failed; falling back to weasyprint on HTML"
|
||||||
|
if command -v weasyprint >/dev/null 2>&1; then
|
||||||
|
weasyprint "$DIR/$DRAFT.html" "$DIR/$DRAFT.pdf" >/dev/null 2>&1 && PDF_OK=1 || PDF_OK=0
|
||||||
|
else
|
||||||
|
PDF_OK=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Build complete:"
|
echo "Build complete:"
|
||||||
echo " $DRAFT.xml (submit this to datatracker)"
|
echo " $DRAFT.xml (submit this to datatracker)"
|
||||||
echo " $DRAFT.txt"
|
echo " $DRAFT.txt"
|
||||||
echo " $DRAFT.html"
|
echo " $DRAFT.html"
|
||||||
|
if [ "${PDF_OK:-0}" = "1" ]; then
|
||||||
|
echo " $DRAFT.pdf"
|
||||||
|
else
|
||||||
|
echo " (PDF generation skipped — missing deps)"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user