From 87e72f9f7f22f082346013e4fdd02cb2b622ab23 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 14 Feb 2022 22:44:50 -0500 Subject: Remove cgit My fork of cgit is now . --- .../cgit/filters/about-formatting.sh | 27 -- www/git.causal.agency/cgit/filters/commit-links.sh | 28 -- .../cgit/filters/email-gravatar.py | 36 --- .../cgit/filters/html-converters/man2html | 4 - .../cgit/filters/html-converters/md2html | 304 --------------------- .../cgit/filters/html-converters/rst2html | 2 - .../cgit/filters/html-converters/txt2html | 4 - .../cgit/filters/syntax-highlighting.py | 55 ---- .../cgit/filters/syntax-highlighting.sh | 121 -------- 9 files changed, 581 deletions(-) delete mode 100755 www/git.causal.agency/cgit/filters/about-formatting.sh delete mode 100755 www/git.causal.agency/cgit/filters/commit-links.sh delete mode 100755 www/git.causal.agency/cgit/filters/email-gravatar.py delete mode 100755 www/git.causal.agency/cgit/filters/html-converters/man2html delete mode 100755 www/git.causal.agency/cgit/filters/html-converters/md2html delete mode 100755 www/git.causal.agency/cgit/filters/html-converters/rst2html delete mode 100755 www/git.causal.agency/cgit/filters/html-converters/txt2html delete mode 100755 www/git.causal.agency/cgit/filters/syntax-highlighting.py delete mode 100755 www/git.causal.agency/cgit/filters/syntax-highlighting.sh (limited to 'www/git.causal.agency/cgit/filters') diff --git a/www/git.causal.agency/cgit/filters/about-formatting.sh b/www/git.causal.agency/cgit/filters/about-formatting.sh deleted file mode 100755 index 85daf9c2..00000000 --- a/www/git.causal.agency/cgit/filters/about-formatting.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# This may be used with the about-filter or repo.about-filter setting in cgitrc. -# It passes formatting of about pages to differing programs, depending on the usage. - -# Markdown support requires python and markdown-python. -# RestructuredText support requires python and docutils. -# Man page support requires groff. - -# The following environment variables can be used to retrieve the configuration -# of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) - -cd "$(dirname $0)/html-converters/" -case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in - *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; - *.rst) exec ./rst2html; ;; - *.[1-9]) exec ./man2html; ;; - *.htm|*.html) exec cat; ;; - *.txt|*) exec ./txt2html; ;; -esac diff --git a/www/git.causal.agency/cgit/filters/commit-links.sh b/www/git.causal.agency/cgit/filters/commit-links.sh deleted file mode 100755 index 796ac308..00000000 --- a/www/git.causal.agency/cgit/filters/commit-links.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# This script can be used to generate links in commit messages. -# -# To use this script, refer to this file with either the commit-filter or the -# repo.commit-filter options in cgitrc. -# -# The following environment variables can be used to retrieve the configuration -# of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) -# - -regex='' - -# This expression generates links to commits referenced by their SHA1. -regex=$regex' -s|\b([0-9a-fA-F]{7,64})\b|\1|g' - -# This expression generates links to a fictional bugtracker. -regex=$regex' -s|#([0-9]+)\b|#\1|g' - -sed -re "$regex" diff --git a/www/git.causal.agency/cgit/filters/email-gravatar.py b/www/git.causal.agency/cgit/filters/email-gravatar.py deleted file mode 100755 index 012113c5..00000000 --- a/www/git.causal.agency/cgit/filters/email-gravatar.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 - -# This script may be used with the email-filter or repo.email-filter settings in cgitrc. -# -# The following environment variables can be used to retrieve the configuration -# of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) -# -# It receives an email address on argv[1] and text on stdin. It prints -# to stdout that text prepended by a gravatar at 10pt. - -import sys -import hashlib -import codecs - -email = sys.argv[1].lower().strip() -if email[0] == '<': - email = email[1:] -if email[-1] == '>': - email = email[0:-1] - -page = sys.argv[2] - -sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach()) -sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) - -md5 = hashlib.md5(email.encode()).hexdigest() -text = sys.stdin.read().strip() - -print("Gravatar " + text) diff --git a/www/git.causal.agency/cgit/filters/html-converters/man2html b/www/git.causal.agency/cgit/filters/html-converters/man2html deleted file mode 100755 index 0ef78841..00000000 --- a/www/git.causal.agency/cgit/filters/html-converters/man2html +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -echo "
" -groff -mandoc -T html -P -r -P -l | egrep -v '(||||||||" diff --git a/www/git.causal.agency/cgit/filters/html-converters/md2html b/www/git.causal.agency/cgit/filters/html-converters/md2html deleted file mode 100755 index 59f43a84..00000000 --- a/www/git.causal.agency/cgit/filters/html-converters/md2html +++ /dev/null @@ -1,304 +0,0 @@ -#!/usr/bin/env python3 -import markdown -import sys -import io -from pygments.formatters import HtmlFormatter -from markdown.extensions.toc import TocExtension -sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') -sys.stdout.write(''' - -''') -sys.stdout.write("
") -sys.stdout.flush() -# Note: you may want to run this through bleach for sanitization -markdown.markdownFromFile( - output_format="html5", - extensions=[ - "markdown.extensions.fenced_code", - "markdown.extensions.codehilite", - "markdown.extensions.tables", - "markdown.extensions.sane_lists", - TocExtension(anchorlink=True)], - extension_configs={ - "markdown.extensions.codehilite":{"css_class":"highlight"}}) -sys.stdout.write("
") diff --git a/www/git.causal.agency/cgit/filters/html-converters/rst2html b/www/git.causal.agency/cgit/filters/html-converters/rst2html deleted file mode 100755 index 02d90f81..00000000 --- a/www/git.causal.agency/cgit/filters/html-converters/rst2html +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec rst2html.py --template <(echo -e "%(stylesheet)s\n%(body_pre_docinfo)s\n%(docinfo)s\n%(body)s") diff --git a/www/git.causal.agency/cgit/filters/html-converters/txt2html b/www/git.causal.agency/cgit/filters/html-converters/txt2html deleted file mode 100755 index 495eeceb..00000000 --- a/www/git.causal.agency/cgit/filters/html-converters/txt2html +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -echo "
"
-sed "s|&|\\&|g;s|'|\\'|g;s|\"|\\"|g;s|<|\\<|g;s|>|\\>|g"
-echo "
" diff --git a/www/git.causal.agency/cgit/filters/syntax-highlighting.py b/www/git.causal.agency/cgit/filters/syntax-highlighting.py deleted file mode 100755 index e912594c..00000000 --- a/www/git.causal.agency/cgit/filters/syntax-highlighting.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 - -# This script uses Pygments and Python3. You must have both installed -# for this to work. -# -# http://pygments.org/ -# http://python.org/ -# -# It may be used with the source-filter or repo.source-filter settings -# in cgitrc. -# -# The following environment variables can be used to retrieve the -# configuration of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) - - -import sys -import io -from pygments import highlight -from pygments.util import ClassNotFound -from pygments.lexers import TextLexer -from pygments.lexers import guess_lexer -from pygments.lexers import guess_lexer_for_filename -from pygments.formatters import HtmlFormatter - - -sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace') -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') -data = sys.stdin.read() -filename = sys.argv[1] -formatter = HtmlFormatter(style='pastie', nobackground=True) - -try: - lexer = guess_lexer_for_filename(filename, data) -except ClassNotFound: - # check if there is any shebang - if data[0:2] == '#!': - lexer = guess_lexer(data) - else: - lexer = TextLexer() -except TypeError: - lexer = TextLexer() - -# highlight! :-) -# printout pygments' css definitions as well -sys.stdout.write('') -sys.stdout.write(highlight(data, lexer, formatter, outfile=None)) diff --git a/www/git.causal.agency/cgit/filters/syntax-highlighting.sh b/www/git.causal.agency/cgit/filters/syntax-highlighting.sh deleted file mode 100755 index 840bc34f..00000000 --- a/www/git.causal.agency/cgit/filters/syntax-highlighting.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# This script can be used to implement syntax highlighting in the cgit -# tree-view by referring to this file with the source-filter or repo.source- -# filter options in cgitrc. -# -# This script requires a shell supporting the ${var##pattern} syntax. -# It is supported by at least dash and bash, however busybox environments -# might have to use an external call to sed instead. -# -# Note: the highlight command (http://www.andre-simon.de/) uses css for syntax -# highlighting, so you'll probably want something like the following included -# in your css file: -# -# Style definition file generated by highlight 2.4.8, http://www.andre-simon.de/ -# -# table.blob .num { color:#2928ff; } -# table.blob .esc { color:#ff00ff; } -# table.blob .str { color:#ff0000; } -# table.blob .dstr { color:#818100; } -# table.blob .slc { color:#838183; font-style:italic; } -# table.blob .com { color:#838183; font-style:italic; } -# table.blob .dir { color:#008200; } -# table.blob .sym { color:#000000; } -# table.blob .kwa { color:#000000; font-weight:bold; } -# table.blob .kwb { color:#830000; } -# table.blob .kwc { color:#000000; font-weight:bold; } -# table.blob .kwd { color:#010181; } -# -# -# Style definition file generated by highlight 2.6.14, http://www.andre-simon.de/ -# -# body.hl { background-color:#ffffff; } -# pre.hl { color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';} -# .hl.num { color:#2928ff; } -# .hl.esc { color:#ff00ff; } -# .hl.str { color:#ff0000; } -# .hl.dstr { color:#818100; } -# .hl.slc { color:#838183; font-style:italic; } -# .hl.com { color:#838183; font-style:italic; } -# .hl.dir { color:#008200; } -# .hl.sym { color:#000000; } -# .hl.line { color:#555555; } -# .hl.mark { background-color:#ffffbb;} -# .hl.kwa { color:#000000; font-weight:bold; } -# .hl.kwb { color:#830000; } -# .hl.kwc { color:#000000; font-weight:bold; } -# .hl.kwd { color:#010181; } -# -# -# Style definition file generated by highlight 3.8, http://www.andre-simon.de/ -# -# body.hl { background-color:#e0eaee; } -# pre.hl { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:'Courier New';} -# .hl.num { color:#b07e00; } -# .hl.esc { color:#ff00ff; } -# .hl.str { color:#bf0303; } -# .hl.pps { color:#818100; } -# .hl.slc { color:#838183; font-style:italic; } -# .hl.com { color:#838183; font-style:italic; } -# .hl.ppc { color:#008200; } -# .hl.opt { color:#000000; } -# .hl.lin { color:#555555; } -# .hl.kwa { color:#000000; font-weight:bold; } -# .hl.kwb { color:#0057ae; } -# .hl.kwc { color:#000000; font-weight:bold; } -# .hl.kwd { color:#010181; } -# -# -# Style definition file generated by highlight 3.13, http://www.andre-simon.de/ -# -# body.hl { background-color:#e0eaee; } -# pre.hl { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:'Courier New',monospace;} -# .hl.num { color:#b07e00; } -# .hl.esc { color:#ff00ff; } -# .hl.str { color:#bf0303; } -# .hl.pps { color:#818100; } -# .hl.slc { color:#838183; font-style:italic; } -# .hl.com { color:#838183; font-style:italic; } -# .hl.ppc { color:#008200; } -# .hl.opt { color:#000000; } -# .hl.ipl { color:#0057ae; } -# .hl.lin { color:#555555; } -# .hl.kwa { color:#000000; font-weight:bold; } -# .hl.kwb { color:#0057ae; } -# .hl.kwc { color:#000000; font-weight:bold; } -# .hl.kwd { color:#010181; } -# -# -# The following environment variables can be used to retrieve the configuration -# of the repository for which this script is called: -# CGIT_REPO_URL ( = repo.url setting ) -# CGIT_REPO_NAME ( = repo.name setting ) -# CGIT_REPO_PATH ( = repo.path setting ) -# CGIT_REPO_OWNER ( = repo.owner setting ) -# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) -# CGIT_REPO_SECTION ( = section setting ) -# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) -# - -# store filename and extension in local vars -BASENAME="$1" -EXTENSION="${BASENAME##*.}" - -[ "${BASENAME}" = "${EXTENSION}" ] && EXTENSION=txt -[ -z "${EXTENSION}" ] && EXTENSION=txt - -# map Makefile and Makefile.* to .mk -[ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk - -# highlight versions 2 and 3 have different commandline options. Specifically, -# the -X option that is used for version 2 is replaced by the -O xhtml option -# for version 3. -# -# Version 2 can be found (for example) on EPEL 5, while version 3 can be -# found (for example) on EPEL 6. -# -# This is for version 2 -exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null - -# This is for version 3 -#exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null -- cgit 1.4.1