summaryrefslogtreecommitdiffstats
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
parentcd173146e98e9acb5c5cb4eea861019cc796932e (diff)
downloaddefanor-dotfiles-0c430f7d5287db519aaca8d0fd4771c3047a8856.zip
defanor-dotfiles-0c430f7d5287db519aaca8d0fd4771c3047a8856.tar.gz
defanor-dotfiles-0c430f7d5287db519aaca8d0fd4771c3047a8856.tar.bz2
Add github-project.xsl
-rw-r--r--.config/pancake/config.yaml1
-rw-r--r--.config/pancake/unclutter/duckduckgo.xsl2
-rw-r--r--.config/pancake/unclutter/github-project.xsl47
-rw-r--r--.config/pancake/unclutter/hacker-news.xsl2
-rw-r--r--.config/pancake/unclutter/lobsters.xsl2
5 files changed, 51 insertions, 3 deletions
diff --git a/.config/pancake/config.yaml b/.config/pancake/config.yaml
index 33d01ec..af28301 100644
--- a/.config/pancake/config.yaml
+++ b/.config/pancake/config.yaml
@@ -55,6 +55,7 @@ unclutter:
hacker-news: ^https://news\.ycombinator\.com/((news|show|ask).*)?$
duckduckgo: ^https://duckduckgo.com/lite/\?q=
lobsters: ^https://lobste.rs/((page|recent|newest).*)?$
+ github-project: ^https://github.com/[^/]+/[^/]+/?$
defaultCommand: ! 'curl --compressed -4 -L -w "
-pancake-
diff --git a/.config/pancake/unclutter/duckduckgo.xsl b/.config/pancake/unclutter/duckduckgo.xsl
index 7db8766..2bf6e2b 100644
--- a/.config/pancake/unclutter/duckduckgo.xsl
+++ b/.config/pancake/unclutter/duckduckgo.xsl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<body>
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>
diff --git a/.config/pancake/unclutter/hacker-news.xsl b/.config/pancake/unclutter/hacker-news.xsl
index 0e1fb63..0f8c352 100644
--- a/.config/pancake/unclutter/hacker-news.xsl
+++ b/.config/pancake/unclutter/hacker-news.xsl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<body>
diff --git a/.config/pancake/unclutter/lobsters.xsl b/.config/pancake/unclutter/lobsters.xsl
index 69a85a1..92b58a7 100644
--- a/.config/pancake/unclutter/lobsters.xsl
+++ b/.config/pancake/unclutter/lobsters.xsl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<body>