From 6e91ecb14fdbb35b3659fe3ad8deb60d96b28e76 Mon Sep 17 00:00:00 2001 From: Marie-Helene Burle Date: Thu, 30 May 2019 17:16:33 -0700 Subject: Add preview support to .rtf, .doc, .docx, .xlsx, .xls --- ranger/data/scope.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index ae09fe39..da467efa 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -85,6 +85,31 @@ handle_extension() { odt2txt "${FILE_PATH}" && exit 5 exit 1;; + ## RTF and DOC + rtf|doc) + ## Preview as markdown conversion + ## note: catdoc does not always work for .doc files + catdoc "${FILE_PATH}" && exit 5 + exit 1;; + + ## DOCX + docx) + ## Preview as markdown conversion + pandoc -t markdown "${FILE_PATH}" && exit 5 + exit 1;; + + ## XLSX + xlsx) + ## Preview as csv conversion + xlsx2csv "${FILE_PATH}" && exit 5 + exit 1;; + + ## XLS + xls) + ## Preview as csv conversion + xls2csv "${FILE_PATH}" && exit 5 + exit 1;; + ## HTML htm|html|xhtml) ## Preview as text conversion @@ -304,7 +329,6 @@ handle_fallback() { exit 1 } - MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then handle_image "${MIMETYPE}" -- cgit 1.4.1-2-gfad0