summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2022-01-03 15:07:23 +0300
committerdefanor <defanor@uberspace.net>2022-01-03 15:07:23 +0300
commitc9424eb89d008a15a4fefd3da90847aca7f60a2e (patch)
treeb906db7d0c2736b6dfa7a8ddac136d514b287c9f
parent3fd41ca76d84c96b22e58666eefbe863b81b4f89 (diff)
Add word counts into note listings
-rw-r--r--tools/xml-to-html.xsl6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/xml-to-html.xsl b/tools/xml-to-html.xsl
index f6aac5b..d317688 100644
--- a/tools/xml-to-html.xsl
+++ b/tools/xml-to-html.xsl
@@ -119,7 +119,11 @@
<dd>
<xsl:value-of select="document/@description" />
(<time><xsl:copy-of select="substring(document/@created,0,8)" /></time>
- <xsl:if test="substring(document/@created,0,8) != substring(document/@modified,0,8)"> to <time><xsl:copy-of select="substring(document/@modified,0,8)" /></time></xsl:if>)
+ <xsl:if test="substring(document/@created,0,8) != substring(document/@modified,0,8)"> to <time><xsl:copy-of select="substring(document/@modified,0,8)" /></time></xsl:if>,
+ <xsl:value-of select=
+ "string-length(normalize-space(document)) -
+ string-length(translate(normalize-space(document), ' ', '')) +
+ 1" /> words)
</dd>
</xsl:template>