summaryrefslogtreecommitdiffstats
path: root/.config/pancake
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-15 00:54:05 +0300
committerdefanor <defanor@uberspace.net>2017-12-15 00:57:21 +0300
commit188b435accffb0438a929077cc8e8a77446c268c (patch)
treef84c68efe6373a0ff091ebfa7a0f1c038df80d7a /.config/pancake
parent157e520082510e78808051d3bc2b46ae5a5bb1cc (diff)
downloaddefanor-dotfiles-188b435accffb0438a929077cc8e8a77446c268c.zip
defanor-dotfiles-188b435accffb0438a929077cc8e8a77446c268c.tar.gz
defanor-dotfiles-188b435accffb0438a929077cc8e8a77446c268c.tar.bz2
Ignore class methods for instances in the Hackage XSLT
Diffstat (limited to '.config/pancake')
-rw-r--r--.config/pancake/unclutter/hackage-haddock.xsl32
1 files changed, 22 insertions, 10 deletions
diff --git a/.config/pancake/unclutter/hackage-haddock.xsl b/.config/pancake/unclutter/hackage-haddock.xsl
index e10b66c..daa0a02 100644
--- a/.config/pancake/unclutter/hackage-haddock.xsl
+++ b/.config/pancake/unclutter/hackage-haddock.xsl
@@ -4,22 +4,34 @@
<xsl:template match="/">
<html>
<body>
- <!-- Mostly copying, just inserting horizontal rules before
- function descriptions. -->
+ <!-- Copy metadata and ToC -->
<xsl:copy-of select="//div[@id='package-header']" />
<xsl:copy-of select="//div[@id='module-header']" />
<xsl:copy-of select="//div[@id='description']" />
<xsl:copy-of select="//div[@id='table-of-contents']" />
<xsl:copy-of select="//div[@id='synopsis']" />
- <div id="interface">
- <xsl:for-each select="//div[@id='interface']/node()">
- <xsl:if test="@class = 'top'">
- <hr />
- </xsl:if>
- <xsl:copy-of select="." />
- </xsl:for-each>
- </div>
+ <xsl:apply-templates select="//div[@id='interface']" />
</body>
</html>
</xsl:template>
+
+ <!-- Function declarations: add <hr /> before them. -->
+ <xsl:template match="div[@class='top']">
+ <hr />
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates />
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- Don't show all the class methods for each instance. -->
+ <xsl:template match="div[@class='subs methods']" />
+
+ <!-- Catch-all: copy and apply templates -->
+ <xsl:template match="node()" priority="0">
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates />
+ </xsl:copy>
+ </xsl:template>
</xsl:stylesheet>