cache supported lexers for pygments

This commit is contained in:
Alexander 2025-06-24 12:07:08 -04:00
parent af97adacbe
commit 84699c3143
3 changed files with 8 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#! /usr/bin/env sh
if [ $# -lt 1 ] || ! pygmentize -L lexers | grep -qw "$1"; then
if [ $# -lt 1 ] || ! grep -qw "$1" lexers.out; then
recode utf8..html
else
pygmentize -l $1 -f html | head -c -13 | awk -F '<pre>' '{print $NF}'
pygmentize -l $1 -f html | awk -F '<pre>' '{print substr($NF, 14)}'
fi