#!/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 that syntax-highlighting-server.py be started to handle # highlighting requests. # configure this to your syntax-highlighting port base_url="http://localhost:4872/" path=$(curl -Gso /dev/null \ -w "%{url_effective}" \ --data-urlencode "filename=$1" \ /highlight) exec curl -sSf \ -H 'Content-Type: text/plain' \ -H 'Expect:' \ --data-binary @- \ "${base_url%/}$path"