Add more previewers

This commit is contained in:
Arun Prakash Jana 2021-03-21 00:01:46 +05:30
parent 4a45e45b30
commit 2fc61a8f48
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -26,7 +26,8 @@
# - optional: pdftoppm(poppler) for pdf thumbnails # - optional: pdftoppm(poppler) for pdf thumbnails
# - optional: gnome-epub-thumbnailer for epub thumbnails (https://gitlab.gnome.org/GNOME/gnome-epub-thumbnailer) # - optional: gnome-epub-thumbnailer for epub thumbnails (https://gitlab.gnome.org/GNOME/gnome-epub-thumbnailer)
# - optional: fontpreview for font preview (https://github.com/sdushantha/fontpreview) # - optional: fontpreview for font preview (https://github.com/sdushantha/fontpreview)
# - optional: w3m for html # - optional: glow or lowdown for markdown
# - optional: w3m or lynx or elinks for html
# - optional: scope.sh file viewer from ranger. # - optional: scope.sh file viewer from ranger.
# To use: # To use:
# 1. drop scope.sh executable in $PATH # 1. drop scope.sh executable in $PATH
@ -195,8 +196,20 @@ preview_file () {
else else
fifo_pager print_bin_info "$1" fifo_pager print_bin_info "$1"
fi fi
elif [ "$mimetype" = "text/html" ]; then elif [ "$ext" = "md" ]; then
if exists glow; then
fifo_pager glow -s dark "$1"
elif exists lowdown; then
lowdown -Tterm "$1"
fi
elif [ "$ext" = "htm" ] || [ "$ext" = "html" ] || [ "$ext" = "xhtml" ]; then
if exists w3m; then
fifo_pager w3m "$1" fifo_pager w3m "$1"
elif exists lynx; then
fifo_pager lynx "$1"
elif exists elinks; then
fifo_pager elinks "$1"
fi
elif [ "$mimetype" = "text/troff" ]; then elif [ "$mimetype" = "text/troff" ]; then
fifo_pager man -Pcat -l "$1" fifo_pager man -Pcat -l "$1"
else else