diff options
Diffstat (limited to '.config/pancake')
-rw-r--r-- | .config/pancake/config.yaml | 1 | ||||
-rw-r--r-- | .config/pancake/unclutter/duckduckgo.xsl | 2 | ||||
-rw-r--r-- | .config/pancake/unclutter/github-project.xsl | 47 | ||||
-rw-r--r-- | .config/pancake/unclutter/hacker-news.xsl | 2 | ||||
-rw-r--r-- | .config/pancake/unclutter/lobsters.xsl | 2 |
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> |