diff --git a/sprunge b/sprunge deleted file mode 100755 index 48301e7..0000000 --- a/sprunge +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -curl -F 'sprunge=<-' http://sprunge.us diff --git a/syntax b/syntax deleted file mode 100755 index 479611c..0000000 --- a/syntax +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -_highlight() { - declare -n syn=$1 - - if [[ "$syn" ]]; then - exec highlight --force --inline-css -f -I -O xhtml -S "$syn" 2>/dev/null - else -# echo " :cgit: No syntax type provided." - exec cat - fi -} - -file_name=$1 -file_extension="${file_name##*.}" - -if ! [[ "$file_name" == "$file_extension" ]]; then - case "$file_extension" in - (md) exec cmark;; - (bash|zsh) syntax='sh';; - (*) syntax=$file_extension;; - esac -fi - -case "$file_name" in - (Makefile) syntax='makefile';; - (PKGBUILD) syntax='sh';; -esac - -# Read and output the first line -read -r - -# Set syntax if the first line is a shebang -if [[ "$REPLY" =~ ^'#!' ]]; then - case "$REPLY" in - (*sh) syntax='sh';; - (*ruby*) syntax='ruby';; - esac -fi - -{ - # Print the first line - printf '%s\n' "$REPLY" - - # Read and output everything - while read -r; do - printf '%s\n' "$REPLY" - done -} | _highlight syntax