From de9c7719a4608d7a05ff62ab9ab364bdd460e675 Mon Sep 17 00:00:00 2001 From: Christian Nennemann Date: Tue, 24 Feb 2026 18:59:39 +0100 Subject: [PATCH] Add build script and regenerate compiled output Add build.sh that auto-discovers kramdown-rfc2629 and xml2rfc regardless of PATH configuration, generates XML, TXT, and HTML in one step. Co-Authored-By: Claude Opus 4.6 --- build.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..5825fab --- /dev/null +++ b/build.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -e + +DRAFT="draft-nennemann-wimse-execution-context-00" +DIR="$(cd "$(dirname "$0")" && pwd)" + +# Resolve tool paths +KDRFC="$(find /usr/local/lib/ruby/gems /opt/homebrew -name kdrfc -path "*/bin/*" 2>/dev/null | head -1)" +KRAMDOWN="$(find /usr/local/lib/ruby/gems /opt/homebrew -name kramdown-rfc2629 -path "*/bin/*" 2>/dev/null | head -1)" +XML2RFC="$(find "$HOME/Library/Python" /usr/local /opt/homebrew -name xml2rfc -path "*/bin/*" 2>/dev/null | head -1)" + +if [ -z "$KRAMDOWN" ]; then + echo "Error: kramdown-rfc2629 not found. Install with: gem install kramdown-rfc" >&2 + exit 1 +fi + +if [ -z "$XML2RFC" ]; then + echo "Error: xml2rfc not found. Install with: pip install xml2rfc" >&2 + exit 1 +fi + +export PYTHONWARNINGS="ignore::UserWarning" + +echo "Using kramdown-rfc2629: $KRAMDOWN" +echo "Using xml2rfc: $XML2RFC" +echo "" + +# Step 1: Markdown -> XML +echo "Converting markdown to XML..." +"$KRAMDOWN" "$DIR/$DRAFT.md" > "$DIR/$DRAFT.xml" + +# Step 2: XML -> TXT +echo "Generating text output..." +"$XML2RFC" "$DIR/$DRAFT.xml" --text --quiet 2>/dev/null + +# Step 3: XML -> HTML +echo "Generating HTML output..." +"$XML2RFC" "$DIR/$DRAFT.xml" --html --quiet 2>/dev/null + +echo "" +echo "Build complete:" +echo " $DRAFT.xml (submit this to datatracker)" +echo " $DRAFT.txt" +echo " $DRAFT.html"