aboutsummaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-17 22:59:45 +0200
committerAdrian Kummerlaender2014-10-17 22:59:45 +0200
commitacacfda54016cbd4437d1ccaa609a52e9c1739d0 (patch)
tree6429c262d2e33fe215613e6b0ac69a0af5f0492b /utility
downloadOverview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar.gz
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar.bz2
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar.lz
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar.xz
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.tar.zst
Overview-acacfda54016cbd4437d1ccaa609a52e9c1739d0.zip
Added basic commit timeline aggregator implementation
* another application based on StaticXSLT * git is instructed to export XML through a special log format definition * the commit messages are processed as Markdown * currently implemented result views are commits-by-repo and a paginated timeline of all commits in every repository * repositories to be read have to be defined in the `repositories.xml` file in the `00_content` level
Diffstat (limited to 'utility')
-rw-r--r--utility/datasource.xsl24
-rwxr-xr-xutility/git_log.sh7
-rw-r--r--utility/master.xsl34
-rw-r--r--utility/reference_commit.xsl25
-rw-r--r--utility/xhtml.xsl18
5 files changed, 108 insertions, 0 deletions
diff --git a/utility/datasource.xsl b/utility/datasource.xsl
new file mode 100644
index 0000000..411086a
--- /dev/null
+++ b/utility/datasource.xsl
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:output
+ method="xml"
+ omit-xml-declaration="no"
+ encoding="UTF-8"
+ indent="no"
+/>
+
+<xsl:variable name="root" select="/datasource"/>
+
+<xsl:template match="/">
+ <datasource>
+ <xsl:apply-templates />
+ </datasource>
+</xsl:template>
+
+<xsl:template match="text()|@*"/>
+
+</xsl:stylesheet>
diff --git a/utility/git_log.sh b/utility/git_log.sh
new file mode 100755
index 0000000..2dfb0bd
--- /dev/null
+++ b/utility/git_log.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+format="<commit hash=\"%h\"><date>%cd</date><message><![CDATA[# %B]]></message></commit>"
+
+ git --no-pager -C $1 log --date=iso --pretty=tformat:"$format" \
+| tidy --input-xml yes --escape-cdata true --wrap 0 \
+| sed -e 's~^\([\*]\)\{3\}~\t\t\*~g' -e 's~^\([\*]\)\{2\}~\t\*~g'
diff --git a/utility/master.xsl b/utility/master.xsl
new file mode 100644
index 0000000..077c9e3
--- /dev/null
+++ b/utility/master.xsl
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:output
+ method="xml"
+ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+ omit-xml-declaration="yes"
+ encoding="UTF-8"
+ indent="no"
+/>
+
+<xsl:variable name="root" select="/datasource"/>
+
+<xsl:template match="/">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="robots" content="all"/>
+ <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
+</head>
+<body>
+ <xsl:apply-templates />
+</body>
+</html>
+</xsl:template>
+
+<xsl:template match="text()|@*"/>
+
+</xsl:stylesheet>
diff --git a/utility/reference_commit.xsl b/utility/reference_commit.xsl
new file mode 100644
index 0000000..63cb064
--- /dev/null
+++ b/utility/reference_commit.xsl
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:template match="@* | node()" mode="commit">
+ <xsl:copy>
+ <xsl:apply-templates select="@* | node()" mode="commit"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="commit" mode="commit">
+ <xsl:copy>
+ <xsl:attribute name="repository">
+ <xsl:value-of select="../@handle"/>
+ </xsl:attribute>
+
+ <xsl:apply-templates select="@* | node()" mode="commit"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="message | date | text()" mode="commit"/>
+
+</xsl:stylesheet>
diff --git a/utility/xhtml.xsl b/utility/xhtml.xsl
new file mode 100644
index 0000000..7347962
--- /dev/null
+++ b/utility/xhtml.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:template match="*" mode="xhtml">
+ <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates select="node()" mode="xhtml"/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="comment() | processing-instruction()" mode="xhtml">
+ <xsl:copy/>
+</xsl:template>
+
+</xsl:stylesheet>