aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-11 20:24:46 +0200
committerAdrian Kummerlaender2014-08-11 20:24:46 +0200
commit49768b7c10fd6466edcd8262587bf142c919ccb5 (patch)
tree5a537a87856b54adfe013e4c8b15e3ce8c716870
parentc1c409e3e486afdc0fe48484a5fc3ccc553f1aaa (diff)
downloadblog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar.gz
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar.bz2
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar.lz
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar.xz
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.tar.zst
blog.kummerlaender.eu-49768b7c10fd6466edcd8262587bf142c919ccb5.zip
Implemented page categorization functionality
* expanded "02_data/pages.xsl" transformation to include pages in subfolders * "03_meta/categories.xsl" transformation generates a categorized view of all pages simmilar to the one provided for tags by "03_meta/tags.xsl" * "99_result/category/category.xsl" transformation generates category overview pages * added basic project related pages inside the "projects" category
-rw-r--r--source/00_content/pages/projects/binary_mapping.md5
-rw-r--r--source/00_content/pages/projects/codepoint_iterator.md3
-rw-r--r--source/00_content/pages/projects/graph_storage.md7
-rw-r--r--source/00_content/pages/projects/input_xslt.md7
-rw-r--r--source/00_content/pages/projects/scribble.md3
-rw-r--r--source/00_content/pages/projects/simple_parser.md5
-rw-r--r--source/02_data/pages.xsl4
-rw-r--r--source/03_meta/categories.xsl45
-rw-r--r--source/99_result/archive.xsl10
-rw-r--r--source/99_result/category/category.xsl39
-rw-r--r--source/99_result/tag/tag.xsl12
-rw-r--r--utility/master.xsl2
12 files changed, 130 insertions, 12 deletions
diff --git a/source/00_content/pages/projects/binary_mapping.md b/source/00_content/pages/projects/binary_mapping.md
new file mode 100644
index 0000000..acf5f47
--- /dev/null
+++ b/source/00_content/pages/projects/binary_mapping.md
@@ -0,0 +1,5 @@
+# BinaryMapping
+
+…is a collection of C++ templates which may be used to map binary structures into tuples and various other structures.
+
+These structures can then be traversed using integrated containers and iterators. This is useful for many kinds of data serialization tasks.
diff --git a/source/00_content/pages/projects/codepoint_iterator.md b/source/00_content/pages/projects/codepoint_iterator.md
new file mode 100644
index 0000000..e2f43de
--- /dev/null
+++ b/source/00_content/pages/projects/codepoint_iterator.md
@@ -0,0 +1,3 @@
+# CodepointIterator
+
+…is a `std::iterator` derived class implementing the `std::bidirectional_iterator_tag` which iterates through unicode codepoints in a UTF8-encoded string.
diff --git a/source/00_content/pages/projects/graph_storage.md b/source/00_content/pages/projects/graph_storage.md
new file mode 100644
index 0000000..43b73c8
--- /dev/null
+++ b/source/00_content/pages/projects/graph_storage.md
@@ -0,0 +1,7 @@
+# GraphStorage
+
+…is a Graph storage and query library based on LevelDB.
+
+It currently supports integer indexed nodes with properties and directed edges with types. The integer IDs are serialized 'by hand', values are serialized using protocol buffers. Everything is stored in a single sorted LevelDB database.
+
+Queries are possible trough a iterator like interface that handles single level queries quite fast. Additionally changes to edges can be monitored using a subscription mechanism.
diff --git a/source/00_content/pages/projects/input_xslt.md b/source/00_content/pages/projects/input_xslt.md
new file mode 100644
index 0000000..2ba4a22
--- /dev/null
+++ b/source/00_content/pages/projects/input_xslt.md
@@ -0,0 +1,7 @@
+# InputXSLT
+
+…is a proof-of-concept implementation of external file access functions for XSLT based on Apache xalan and xerces.
+
+### Why?
+
+Contrary to popular opinion I actually like XSLT as a content transformation language and have built - amongst other things - my personal website on top of it. While I used the XSLT based Symphony CMS for that particular endeavour, the intention behind the experiment contained within this repository is to develop XSLT extensions enabling the development of static site generators using XSLT as both a template and application language.
diff --git a/source/00_content/pages/projects/scribble.md b/source/00_content/pages/projects/scribble.md
new file mode 100644
index 0000000..9bb2158
--- /dev/null
+++ b/source/00_content/pages/projects/scribble.md
@@ -0,0 +1,3 @@
+# Scribble
+
+…is a multi-client scribble board using HTML5-Canvas as drawing and socket.io as communication technology.
diff --git a/source/00_content/pages/projects/simple_parser.md b/source/00_content/pages/projects/simple_parser.md
new file mode 100644
index 0000000..e6b8f25
--- /dev/null
+++ b/source/00_content/pages/projects/simple_parser.md
@@ -0,0 +1,5 @@
+# SimpleParser
+
+…is a simple parser for resolving mathematical terms.
+
+The term is parsed by generating a binary expression tree using the Shunting-Yard algorithm. The implementation itself does not use any external libraries and relies fully on the features provided by the C++ language and the standard library.
diff --git a/source/02_data/pages.xsl b/source/02_data/pages.xsl
index 8447c9d..201c575 100644
--- a/source/02_data/pages.xsl
+++ b/source/02_data/pages.xsl
@@ -15,10 +15,10 @@
<target mode="plain" value="pages.xml"/>
</xsl:variable>
-<xsl:template match="files/pages/file[./extension = '.md']">
+<xsl:template match="files/pages//file[./extension = '.md']">
<xsl:variable name="content">
<xsl:call-template name="formatter">
- <xsl:with-param name="format">/usr/bin/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>
diff --git a/source/03_meta/categories.xsl b/source/03_meta/categories.xsl
new file mode 100644
index 0000000..a0b1a41
--- /dev/null
+++ b/source/03_meta/categories.xsl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ xmlns:InputXSLT="function.inputxslt.application"
+ exclude-result-prefixes="xalan InputXSLT"
+>
+
+<xsl:include href="[utility/datasource.xsl]"/>
+
+<xsl:variable name="meta">
+ <datasource type="main" mode="full" source="target/01_files/source.xml" target="files"/>
+ <datasource type="support" mode="full" source="target/02_data/pages.xml" target="pages"/>
+ <target mode="plain" value="categories.xml"/>
+</xsl:variable>
+
+<xsl:template name="get_page_data">
+ <xsl:param name="handle"/>
+
+ <xsl:variable name="page" select="$root/pages/entry[@handle = $handle]"/>
+
+ <title>
+ <xsl:value-of select="$page/title"/>
+ </title>
+ <digest>
+ <xsl:copy-of select="$page/content/p[1]/node()"/>
+ </digest>
+</xsl:template>
+
+<xsl:template match="files/pages/*[name() != 'file']">
+ <entry handle="{name()}">
+ <xsl:apply-templates />
+ </entry>
+</xsl:template>
+
+<xsl:template match="files/pages/*/file[./extension = '.md']">
+ <page handle="{./name}">
+ <xsl:call-template name="get_page_data">
+ <xsl:with-param name="handle" select="./name"/>
+ </xsl:call-template>
+ </page>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/source/99_result/archive.xsl b/source/99_result/archive.xsl
index 34dc81c..4d459c4 100644
--- a/source/99_result/archive.xsl
+++ b/source/99_result/archive.xsl
@@ -32,12 +32,10 @@
<xsl:template match="microblog">
<div class="column taglist archivtag">
- <div>
- <a href="https://twitter.com/KnairdA">Microblog:</a>
- <ul class="tweetlist">
- <xsl:apply-templates select="item[substring(text, 1, 1) != '@'][position() &lt;= 7]" />
- </ul>
- </div>
+ <a href="https://twitter.com/KnairdA">Microblog:</a>
+ <ul class="prettylist">
+ <xsl:apply-templates select="item[substring(text, 1, 1) != '@'][position() &lt;= 9]" />
+ </ul>
</div>
</xsl:template>
diff --git a/source/99_result/category/category.xsl b/source/99_result/category/category.xsl
new file mode 100644
index 0000000..ef6f388
--- /dev/null
+++ b/source/99_result/category/category.xsl
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:include href="[utility/master.xsl]"/>
+
+<xsl:variable name="meta">
+ <datasource type="main" mode="iterate" source="target/03_meta/categories.xml" target="category"/>
+ <datasource type="support" mode="full" source="target/03_meta/meta.xml" target="meta"/>
+ <target mode="xpath" value="concat(xalan:nodeset($datasource)/datasource/category/entry/@handle, '/index.html')"/>
+</xsl:variable>
+
+<xsl:template name="title-text">
+ <xsl:value-of select="/datasource/category/entry/@handle"/>
+</xsl:template>
+
+<xsl:template match="category/entry">
+ <div class="archiv columns">
+ <ul class="prettylist">
+ <xsl:apply-templates />
+ </ul>
+ </div>
+</xsl:template>
+
+<xsl:template match="category/entry/page">
+ <li>
+ <em>»</em>
+ <a href="{$url}/page/{@handle}">
+ <strong><xsl:value-of select="title"/></strong>
+ <p>
+ <xsl:copy-of select="digest/node()"/>
+ </p>
+ </a>
+ </li>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/source/99_result/tag/tag.xsl b/source/99_result/tag/tag.xsl
index 8eb6ca0..fd79a3c 100644
--- a/source/99_result/tag/tag.xsl
+++ b/source/99_result/tag/tag.xsl
@@ -17,8 +17,10 @@
</xsl:template>
<xsl:template match="tag/entry">
- <div class="archiv left articlelist archivlist">
- All articles tagged as &#187;<xsl:value-of select="@handle"/>&#171;
+ <div class="archiv articlelist archivlist">
+ <xsl:text>All articles tagged as &#187;</xsl:text>
+ <xsl:value-of select="@handle"/>
+ <xsl:text>&#171;</xsl:text>
<ol>
<xsl:apply-templates />
</ol>
@@ -27,7 +29,11 @@
<xsl:template match="tag/entry/article">
<li>
- <xsl:value-of select="date"/> » <a href="{$url}/article/{@handle}"><xsl:value-of select="title"/></a>
+ <xsl:value-of select="date"/>
+ <xsl:text> » </xsl:text>
+ <a href="{$url}/article/{@handle}">
+ <xsl:value-of select="title"/>
+ </a>
</li>
</xsl:template>
diff --git a/utility/master.xsl b/utility/master.xsl
index 73105ed..f3d6af4 100644
--- a/utility/master.xsl
+++ b/utility/master.xsl
@@ -49,7 +49,7 @@
<ul>
<li><a href="{$url}/0">Start</a></li>
<li><a href="{$url}/archive">Archive</a></li>
- <li><a href="{$url}/projects">Projects</a></li>
+ <li><a href="{$url}/category/projects">Projects</a></li>
<li><a href="{$url}/page/contact">Contact</a></li>
<li class="last_item"><a href="{$url}/atom.xml">Feed</a></li>
</ul>