aboutsummaryrefslogtreecommitdiff
path: root/source/02_data
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-05 22:15:51 +0200
committerAdrian Kummerlaender2014-08-05 22:15:51 +0200
commit96895b711b282e914d064273ef9f74b2c5f0c920 (patch)
treed1e48a5de0830523e772388e19a5f8d98ae76c18 /source/02_data
parenta3e70bb2b562b0ebee7032b6714206c41b556513 (diff)
downloadblog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar.gz
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar.bz2
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar.lz
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar.xz
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.tar.zst
blog.kummerlaender.eu-96895b711b282e914d064273ef9f74b2c5f0c920.zip
Added basic article content embellishment
* i.e. inline code is automatically highlighted using an external syntax highligher
Diffstat (limited to 'source/02_data')
-rw-r--r--source/02_data/articles.xsl19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 6401b64..bbe6f40 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -29,6 +29,23 @@
</xsl:apply-templates>
</xsl:template>
+<xsl:template match="@*|node()" mode="content_transform">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" mode="content_transform"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="pre/code" mode="content_transform">
+ <xsl:variable name="formatted_code">
+ <xsl:call-template name="formatter">
+ <xsl:with-param name="format">/usr/bin/highlight.sh</xsl:with-param>
+ <xsl:with-param name="source" select="text()"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:copy-of select="xalan:nodeset($formatted_code)/pre/node()"/>
+</xsl:template>
+
<xsl:template match="files/articles/file[./extension = '.md']">
<xsl:variable name="content">
<xsl:call-template name="formatter">
@@ -55,7 +72,7 @@
</xsl:call-template>
</tags>
<content>
- <xsl:copy-of select="xalan:nodeset($content)/*[name() != 'h1']"/>
+ <xsl:apply-templates mode="content_transform" select="xalan:nodeset($content)/*[name() != 'h1']"/>
</content>
</entry>
</xsl:template>