# HTML Pages:
htm|html|xhtml)
try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
- try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
- try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
;; # fall back to highlight/cat if the text browsers fail
esac
case "$mimetype" in
# Syntax highlight for text files:
text/* | */xml)
- if [ "$(tput colors)" -ge 256 ]; then
- pygmentize_format=terminal256
- highlight_format=xterm256
- else
- pygmentize_format=terminal
- highlight_format=ansi
- fi
-# try safepipe /usr/share/source-highlight/src-hilite-lesspipe.sh --out-format=${highlight_format} "$path" && { dump | trim; exit 5; }
try safepipe less "$path" && { dump | trim; exit 5; }
- try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; }
exit 2;;
# Ascii-previews of images:
image/*)