From 93ace2a4b6e9788adecd690020dc57e576c608cd Mon Sep 17 00:00:00 2001 From: Nici Date: Sun, 13 Feb 2022 18:50:30 +0100 Subject: add drawio Image-Preview --- ranger/data/scope.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 864e39ab..9c27bc91 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -49,7 +49,7 @@ OPENSCAD_COLORSCHEME="${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}" handle_extension() { case "${FILE_EXTENSION_LOWER}" in - ## Archive + ## Archive a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) atool --list -- "${FILE_PATH}" && exit 5 @@ -90,6 +90,11 @@ handle_extension() { ## Preview as text conversion (unsupported by pandoc for markdown) odt2txt "${FILE_PATH}" && exit 5 exit 1;; + +# drawio) +# ## Preview as image +# draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 +# exit 1;; ## XLSX xlsx) -- cgit 1.4.1-2-gfad0 From 49bb550cb2fbef22e2b10782d6aa2afe0dc61943 Mon Sep 17 00:00:00 2001 From: Nici Date: Sun, 13 Feb 2022 19:14:34 +0100 Subject: fix indent --- ranger/data/scope.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 9c27bc91..2d1321c2 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -49,7 +49,7 @@ OPENSCAD_COLORSCHEME="${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}" handle_extension() { case "${FILE_EXTENSION_LOWER}" in - ## Archive + ## Archive a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) atool --list -- "${FILE_PATH}" && exit 5 -- cgit 1.4.1-2-gfad0 From 85050cc349f3893869f1f4e4a79263a234253b92 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 27 Feb 2022 15:20:11 +0100 Subject: doc: Fix manpage for name filter_stack filter Fixes #2548 --- doc/ranger.1 | 8 ++++---- doc/ranger.pod | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 4989e155..22c2adc6 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.3" "2022-02-05" "ranger manual" +.TH RANGER 1 "ranger-1.9.3" "2022-02-27" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1447,8 +1447,8 @@ following \f(CW\*(C`FILTER_TYPE\*(C'\fRs are available: Filter files so only files that have duplicates in the same directory are shown. Useful when cleaning up identical songs and memes that were saved using distinct file names. -.IP "filename \s-1NAME\s0" 2 -.IX Item "filename NAME" +.IP "name \s-1NAME\s0" 2 +.IX Item "name NAME" Filter files that contain \s-1NAME\s0 in the filename, regular expression syntax is allowed. .IP "hash \s-1PATH\s0" 2 diff --git a/doc/ranger.pod b/doc/ranger.pod index 0f1ce0b7..bc9f8e21 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1564,7 +1564,7 @@ Filter files so only files that have duplicates in the same directory are shown. Useful when cleaning up identical songs and memes that were saved using distinct file names. -=item filename NAME +=item name NAME Filter files that contain NAME in the filename, regular expression syntax is allowed. -- cgit 1.4.1-2-gfad0 From 6ab96ec304f7aa5dabd47448908cccd5f0a55a1b Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 19:21:14 +0100 Subject: doc: Add openscad dependency to man page --- doc/ranger.pod | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ranger.pod b/doc/ranger.pod index bc9f8e21..b5908535 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -292,6 +292,10 @@ C or C for JSON files C for font previews +=item - + +C for 3D model previews (stl, off, dxf, scad, csg) + =back =back -- cgit 1.4.1-2-gfad0 From 4f38c63ef0725f402a518b7f7c272bfefb8bd5d6 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 19:22:49 +0100 Subject: doc: Split lines in man page --- doc/ranger.pod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ranger.pod b/doc/ranger.pod index b5908535..5980f16f 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -254,7 +254,8 @@ C, C, C and/or C<7z> to preview archives =item - -C, C, C, C and/or C (and C) to preview archives as their first image +C, C, C, C and/or C (and C) to preview +archives as their first image =item - @@ -262,7 +263,8 @@ C, C or C to preview html pages =item - -C or C (and C) for textual pdf previews, C to preview as image +C or C (and C) for textual pdf previews, C to +preview as image =item - -- cgit 1.4.1-2-gfad0 From 164c44c599daa814f9e5b773e074a97834554c5c Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 19:25:33 +0100 Subject: Makefile: Drop README.md from man page requisites I believe at some point I added the `README.md` to the prerequisites for the man pages so we wouldn't forget to update them whenever the README was touched. This hasn't worked very well and it often makes particularly the rifle man page regenerate when not needed. --- Makefile | 4 ++-- doc/ranger.1 | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3479bb2d..568ebd42 100644 --- a/Makefile +++ b/Makefile @@ -135,13 +135,13 @@ test_other: test: test_py test_shellcheck @echo "$(bold)Finished testing: All tests passed!$(normal)" -doc/ranger.1: doc/ranger.pod README.md +doc/ranger.1: doc/ranger.pod pod2man --stderr --center='ranger manual' \ --date='$(NAME)-$(VERSION)' \ --release=$(shell date -u '+%Y-%m-%d') \ doc/ranger.pod doc/ranger.1 -doc/rifle.1: doc/rifle.pod README.md +doc/rifle.1: doc/rifle.pod pod2man --stderr --center='rifle manual' \ --date='$(NAME_RIFLE)-$(VERSION_RIFLE)' \ --release=$(shell date -u '+%Y-%m-%d') \ diff --git a/doc/ranger.1 b/doc/ranger.1 index 22c2adc6..377930ed 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.3" "2022-02-27" "ranger manual" +.TH RANGER 1 "ranger-1.9.3" "2022-03-18" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -318,11 +318,13 @@ are automatically used when available but completely optional. .IP "\-" 2 \&\f(CW\*(C`atool\*(C'\fR, \f(CW\*(C`bsdtar\*(C'\fR, \f(CW\*(C`unrar\*(C'\fR and/or \f(CW\*(C`7z\*(C'\fR to preview archives .IP "\-" 2 -\&\f(CW\*(C`bsdtar\*(C'\fR, \f(CW\*(C`tar\*(C'\fR, \f(CW\*(C`unrar\*(C'\fR, \f(CW\*(C`unzip\*(C'\fR and/or \f(CW\*(C`zipinfo\*(C'\fR (and \f(CW\*(C`sed\*(C'\fR) to preview archives as their first image +\&\f(CW\*(C`bsdtar\*(C'\fR, \f(CW\*(C`tar\*(C'\fR, \f(CW\*(C`unrar\*(C'\fR, \f(CW\*(C`unzip\*(C'\fR and/or \f(CW\*(C`zipinfo\*(C'\fR (and \f(CW\*(C`sed\*(C'\fR) to preview +archives as their first image .IP "\-" 2 \&\f(CW\*(C`lynx\*(C'\fR, \f(CW\*(C`w3m\*(C'\fR or \f(CW\*(C`elinks\*(C'\fR to preview html pages .IP "\-" 2 -\&\f(CW\*(C`pdftotext\*(C'\fR or \f(CW\*(C`mutool\*(C'\fR (and \f(CW\*(C`fmt\*(C'\fR) for textual pdf previews, \f(CW\*(C`pdftoppm\*(C'\fR to preview as image +\&\f(CW\*(C`pdftotext\*(C'\fR or \f(CW\*(C`mutool\*(C'\fR (and \f(CW\*(C`fmt\*(C'\fR) for textual pdf previews, \f(CW\*(C`pdftoppm\*(C'\fR to +preview as image .IP "\-" 2 \&\f(CW\*(C`djvutxt\*(C'\fR for textual DjVu previews, \f(CW\*(C`ddjvu\*(C'\fR to preview as image .IP "\-" 2 @@ -337,6 +339,8 @@ are automatically used when available but completely optional. \&\f(CW\*(C`python\*(C'\fR or \f(CW\*(C`jq\*(C'\fR for \s-1JSON\s0 files .IP "\-" 2 \&\f(CW\*(C`fontimage\*(C'\fR for font previews +.IP "\-" 2 +\&\f(CW\*(C`openscad\*(C'\fR for 3D model previews (stl, off, dxf, scad, csg) .RE .RS 2 .RE -- cgit 1.4.1-2-gfad0 From bdd90a730d0ca3e26376dc1247a6f5fc29011b4d Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 18:54:27 +0100 Subject: scope: Move draw.io preview to handle_image --- ranger/data/scope.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 2d1321c2..003ce65b 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -90,11 +90,6 @@ handle_extension() { ## Preview as text conversion (unsupported by pandoc for markdown) odt2txt "${FILE_PATH}" && exit 5 exit 1;; - -# drawio) -# ## Preview as image -# draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 -# exit 1;; ## XLSX xlsx) @@ -267,19 +262,23 @@ handle_image() { # mv "${TMPPNG}" "${IMAGE_CACHE_PATH}" # } - # case "${FILE_EXTENSION_LOWER}" in - # ## 3D models - # ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH} - # ## is hardcoded as jpeg. So we make a tempfile.png and just - # ## move/rename it to jpg. This works because image libraries are - # ## smart enough to handle it. - # csg|scad) - # openscad_image "${FILE_PATH}" && exit 6 - # ;; - # 3mf|amf|dxf|off|stl) - # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 - # ;; - # esac + case "${FILE_EXTENSION_LOWER}" in + ## 3D models + ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH} + ## is hardcoded as jpeg. So we make a tempfile.png and just + ## move/rename it to jpg. This works because image libraries are + ## smart enough to handle it. + # csg|scad) + # openscad_image "${FILE_PATH}" && exit 6 + # ;; + # 3mf|amf|dxf|off|stl) + # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 + # ;; + # drawio) + # draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 + # exit 1;; + + esac } handle_mime() { -- cgit 1.4.1-2-gfad0 From 715b5aa0bc42fab32bf0389b971149280e54b594 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 18:55:00 +0100 Subject: scope: Fix draw.io width and enable by default --- ranger/data/scope.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 003ce65b..5e0e66ac 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -274,10 +274,10 @@ handle_image() { # 3mf|amf|dxf|off|stl) # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 # ;; - # drawio) - # draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 - # exit 1;; - + drawio) + draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" \ + --width "${DEFAULT_SIZE%x*}" && exit 6 + exit 1;; esac } -- cgit 1.4.1-2-gfad0 From 7cd459fd764c77d3901f1b9303f5b41c4cee939a Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 19:16:38 +0100 Subject: README: Add draw.io dependency --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 10bdcfb5..d7fe30b3 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ For enhanced file previews (with `scope.sh`): * `python` or `jq` for JSON files * `fontimage` for font previews * `openscad` for 3D model previews (`stl`, `off`, `dxf`, `scad`, `csg`) +* `draw.io` for [draw.io](https://app.diagrams.net/) diagram previews + (`drawio` extension) Installing ---------- -- cgit 1.4.1-2-gfad0 From b54f694e99fa5eec0f6833f11a181d2ec96b5505 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 19:34:27 +0100 Subject: doc: Add draw.io dependency to man page --- doc/ranger.1 | 3 +++ doc/ranger.pod | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index 377930ed..cc166604 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -341,6 +341,9 @@ preview as image \&\f(CW\*(C`fontimage\*(C'\fR for font previews .IP "\-" 2 \&\f(CW\*(C`openscad\*(C'\fR for 3D model previews (stl, off, dxf, scad, csg) +.IP "\-" 2 +\&\f(CW\*(C`draw.io\*(C'\fR for draw.io diagram previews (drawio +extension) .RE .RS 2 .RE diff --git a/doc/ranger.pod b/doc/ranger.pod index 5980f16f..f3413856 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -298,6 +298,11 @@ C for font previews C for 3D model previews (stl, off, dxf, scad, csg) +=item - + +C for draw.io L diagram previews (drawio +extension) + =back =back -- cgit 1.4.1-2-gfad0