aboutsummaryrefslogtreecommitdiff
path: root/source/02_data
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-10 13:09:42 +0200
committerAdrian Kummerlaender2014-08-10 13:09:42 +0200
commit71fcf7c296f16e31fe0e75eee08059456c080206 (patch)
treeafdad32b59cb9f77464aba2395d53b5963141e98 /source/02_data
parent1232de16d63bc16ba84999018ff5b468c7b878ba (diff)
downloadblog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar.gz
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar.bz2
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar.lz
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar.xz
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.tar.zst
blog.kummerlaender.eu-71fcf7c296f16e31fe0e75eee08059456c080206.zip
Switched content formatter to kramdown
* implemented language selection for automatic syntax highlighting ** language selection requires the language to be used to be passed as a class of the code element ** kramdown enables easy definition of this class attribute * kramdown offers more functionality such as table and class attribute support * updated all articles accordingly
Diffstat (limited to 'source/02_data')
-rw-r--r--source/02_data/articles.xsl14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 1e672c7..642f417 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -24,7 +24,17 @@
<xsl:template match="pre" mode="embellish">
<xsl:variable name="formatted_code">
<xsl:call-template name="formatter">
- <xsl:with-param name="format">highlight --out-format=xhtml --inline-css --style=molokai --syntax=cpp -f --enclose-pre --wrap-simple</xsl:with-param>
+ <xsl:with-param name="format">
+ <xsl:text>highlight --out-format=xhtml --inline-css --style=molokai --fragment --enclose-pre --wrap-simple --syntax=</xsl:text>
+ <xsl:choose>
+ <xsl:when test="code/@class">
+ <xsl:value-of select="substring(code/@class, 10, string-length(code/@class))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>txt</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
<xsl:with-param name="source" select="code/text()"/>
</xsl:call-template>
</xsl:variable>
@@ -51,7 +61,7 @@
<xsl:template match="files/articles/file[./extension = '.md']">
<xsl:variable name="content">
<xsl:call-template name="formatter">
- <xsl:with-param name="format">markdown</xsl:with-param>
+ <xsl:with-param name="format">kramdown</xsl:with-param>
<xsl:with-param name="source" select="InputXSLT:read-file(./full)/text()"/>
</xsl:call-template>
</xsl:variable>