summaryrefslogtreecommitdiff
path: root/.config/pancake/unclutter/github-project.xsl
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-14 01:45:42 +0300
committerdefanor <defanor@uberspace.net>2017-12-14 01:47:18 +0300
commit0c430f7d5287db519aaca8d0fd4771c3047a8856 (patch)
tree931245643e9cea1becca9ca55afdd39f287b39b3 /.config/pancake/unclutter/github-project.xsl
parentcd173146e98e9acb5c5cb4eea861019cc796932e (diff)
Add github-project.xsl
Diffstat (limited to '.config/pancake/unclutter/github-project.xsl')
-rw-r--r--.config/pancake/unclutter/github-project.xsl47
1 files changed, 47 insertions, 0 deletions
diff --git a/.config/pancake/unclutter/github-project.xsl b/.config/pancake/unclutter/github-project.xsl
new file mode 100644
index 0000000..3b24c8a
--- /dev/null
+++ b/.config/pancake/unclutter/github-project.xsl
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="html" indent="yes"/>
+ <xsl:template match="/">
+ <xsl:variable name="project_uri"
+ select="//strong[@itemprop='name']/a/@href"/>
+ <html>
+ <body>
+ <!-- header -->
+ <h1>
+ <xsl:copy-of select="//a[@rel='author']" />
+ /
+ <xsl:copy-of select="//strong[@itemprop='name']/a" />
+ </h1>
+
+ <!-- issues and such -->
+ <p>
+ <a href="{$project_uri}/issues">
+ issues:
+ <xsl:copy-of select="//a[@data-hotkey='g i']/span[@class='Counter']" />
+ </a>
+ |
+ <a href="{$project_uri}/pulls">
+ PRs:
+ <xsl:copy-of select="//a[@data-hotkey='g p']/span[@class='Counter']" />
+ </a>
+ |
+ <a href="{$project_uri}/wiki">
+ wiki
+ </a>
+ </p>
+
+ <!-- files -->
+ <p>
+ <xsl:for-each select="//div[@class='file-wrap']//tr[position()>1]">
+ <xsl:copy-of select="td[@class='content']//a" />
+ (<xsl:copy-of select=".//time-ago" />)
+ <br/>
+ </xsl:for-each>
+ </p>
+
+ <!-- readme -->
+ <xsl:copy-of select="//div[@id='readme']" />
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet>