diff options
Diffstat (limited to 'tools/html-to-atom.sh')
-rwxr-xr-x | tools/html-to-atom.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/html-to-atom.sh b/tools/html-to-atom.sh new file mode 100755 index 0000000..aa665b0 --- /dev/null +++ b/tools/html-to-atom.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Composes an atom feed out of XHTML files. + +BASEDIR=~/homepage +TOOLS="${BASEDIR}/tools" +SOURCES="${BASEDIR}/src" +ATOM="${BASEDIR}/atom.xml" + +(echo '<?xml version="1.0" encoding="UTF-8"?>' && + echo '<list>' && + find "${BASEDIR}" -name '*.xhtml' | + grep -Ev "^(${TOOLS}|${SOURCES}).*" | + sed -e "sS^${BASEDIR}\(.*\)S<entry name=\"\\1\" />S" && + echo '</list>') | + xsltproc "${TOOLS}/html-to-atom-dump.xsl" - | + xsltproc "${TOOLS}/atom-sort.xsl" - | + xsltproc "${TOOLS}/atom-limit.xsl" - | + xmllint --format --nsclean - > "${ATOM}" |