aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-09-22 21:13:57 +0200
committerAdrian Kummerlaender2021-09-22 21:13:57 +0200
commit24373f1e7d2f536efac22caa71de50223aca12d7 (patch)
tree56b90f9fe6960dc640d3e2d7b25b87edbc211228
parent254b008436f3649e77cd55154c77c949fdf3d3b4 (diff)
downloadblog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar.gz
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar.bz2
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar.lz
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar.xz
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.tar.zst
blog.kummerlaender.eu-24373f1e7d2f536efac22caa71de50223aca12d7.zip
Add basic support for Org articles
-rw-r--r--source/01_data/articles.xsl3
-rw-r--r--utility/formatter.xsl19
2 files changed, 17 insertions, 5 deletions
diff --git a/source/01_data/articles.xsl b/source/01_data/articles.xsl
index c25fe2a..2c4fa72 100644
--- a/source/01_data/articles.xsl
+++ b/source/01_data/articles.xsl
@@ -27,10 +27,11 @@
</xsl:apply-templates>
</xsl:template>
-<xsl:template match="files/directory[@name = 'articles']/file[@extension = '.md']">
+<xsl:template match="files/directory[@name = 'articles']/file[@extension = '.md' or @extension = '.org']">
<xsl:variable name="content">
<xsl:call-template name="formatter">
<xsl:with-param name="source" select="InputXSLT:read-file(./full)/text()"/>
+ <xsl:with-param name="format" select="substring(@extension,2)"/>
</xsl:call-template>
</xsl:variable>
diff --git a/utility/formatter.xsl b/utility/formatter.xsl
index ec6db47..fb4acec 100644
--- a/utility/formatter.xsl
+++ b/utility/formatter.xsl
@@ -126,12 +126,23 @@
<xsl:template name="formatter">
<xsl:param name="source"/>
+ <xsl:param name="format"/>
<xsl:variable name="content">
- <xsl:call-template name="plain_formatter">
- <xsl:with-param name="format">pandoc -f markdown -t html4 --katex --no-highlight -fmarkdown-implicit_figures</xsl:with-param>
- <xsl:with-param name="source" select="$source"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="contains($format, 'md')">
+ <xsl:call-template name="plain_formatter">
+ <xsl:with-param name="format">pandoc -f markdown -t html4 --katex --no-highlight -fmarkdown-implicit_figures</xsl:with-param>
+ <xsl:with-param name="source" select="$source"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="plain_formatter">
+ <xsl:with-param name="format">pandoc -f <xsl:value-of select="$format"/> -t html4 --katex --no-highlight</xsl:with-param>
+ <xsl:with-param name="source" select="$source"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:apply-templates select="xalan:nodeset($content)" mode="embellish"/>