From e5a834d16bd9e59e4c71b7d8f30488008fafeb66 Mon Sep 17 00:00:00 2001 From: lucidiot Date: Sat, 24 Jul 2021 23:40:10 +0200 Subject: [PATCH] Add CDF feed, close #3 --- build.sh | 21 +++++-- content/index.md | 2 + xsl/tree-cdf.xsl | 100 ++++++++++++++++++++++++++++++++ xsl/{tree.xsl => tree-html.xsl} | 0 4 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 xsl/tree-cdf.xsl rename xsl/{tree.xsl => tree-html.xsl} (100%) diff --git a/build.sh b/build.sh index e7f6630..359216b 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,10 @@ -#!/bin/bash +#!/bin/bash -e shopt -s globstar include_after=$(mktemp "/tmp/$USER.XXXXXXXXXX") +tree_output=$(mktemp "/tmp/$USER.XXXXXXXXXX") tree_file=$(mktemp "/tmp/$USER.XXXXXXXXXX") -trap "rm \"$include_after\" \"$tree_file\"" EXIT +trap "rm \"$include_after\" \"$tree_output\" \"$tree_file\"" EXIT # Preprocess include-after.html sed "s/{{ now }}/$(date --iso-8601=seconds)/g;s/{{ generator }}/$(pandoc --version | head -n1)/g" include-after.html > "$include_after" @@ -45,17 +46,25 @@ function link_assets { } link_assets assets -# Build the 'everything' page +# Build the 'everything' page and CDF feed +echo 'Building article list' +pushd html >/dev/null +tree --du --si -X --prune -P '*.html' > "$tree_output" +popd >/dev/null + echo "--- title: everything --- " > "$tree_file" -pushd html >/dev/null -tree --du --si -X --prune -P '*.html' | xsltproc ../xsl/tree.xsl - >> "$tree_file" -popd >/dev/null +xsltproc xsl/tree-html.xsl "$tree_output" >> "$tree_file" convert "$tree_file" "html/everything.html" +xsltproc xsl/tree-cdf.xsl "$tree_output" | xmllint --format - > "html/everything.cdf" +xmllint --noout --schema "assets/xsd/cdf.xsd" "html/everything.cdf" +chmod 644 "html/everything.cdf" + # Build an RSS feed +echo 'Building RSS feed' echo ' + + + + + + + + + + lucidiot's wiki + + + + + + + + + + / + + + + + + + + bytes + + + + + <xsl:value-of select="@name" /> + + + + + + + + + + + + + / + + / + + + + + + + bytes + + + + + + + + + <xsl:value-of select="@name" /> + + + + + + + + director + + + y + + + ies + + + and + + file + + s + + + , + + bytes + + + + + diff --git a/xsl/tree.xsl b/xsl/tree-html.xsl similarity index 100% rename from xsl/tree.xsl rename to xsl/tree-html.xsl