From e6a489b719721349740b7c04c091ad420c59206c Mon Sep 17 00:00:00 2001 From: William Melody Date: Thu, 21 Sep 2023 18:17:11 -0700 Subject: [PATCH] Add support for `mdv` with `$NB_MARKDOWN_TOOL`. refs gh-62 --- README.md | 4 +++- nb | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a98d50ec1..046f2a4c8 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,7 @@ Also supported for various enhancements: [Lynx](https://en.wikipedia.org/wiki/Lynx_(web_browser)), [`mdcat`](https://github.com/swsnr/mdcat), [`mdless`](https://github.com/ttscoff/mdless), +[`mdv`](https://github.com/axiros/terminal_markdown_viewer), [Midnight Commander (`mc`)](https://en.wikipedia.org/wiki/Midnight_Commander), [`mpg123`](https://en.wikipedia.org/wiki/Mpg123), [MPlayer](https://en.wikipedia.org/wiki/MPlayer), @@ -1438,6 +1439,7 @@ Supported file types and tools include: - [`glow`](https://github.com/charmbracelet/glow) - [`mdcat`](https://github.com/swsnr/mdcat) - [`mdless`](https://github.com/ttscoff/mdless) + - [`mdv`](https://github.com/axiros/terminal_markdown_viewer) - PDF files: - [`termpdf.py`](https://github.com/dsanson/termpdf.py) with [kitty](https://sw.kovidgoyal.net/kitty/) @@ -9521,7 +9523,7 @@ Example Values: '0', '1' ```text Default: '' (default pager) -Supported Values: 'bat', 'glow', 'mdcat', 'mdless' +Supported Values: 'bat', 'glow', 'mdcat', 'mdless', 'mdv' ```

diff --git a/nb b/nb index dbcb08bc6..94d351834 100755 --- a/nb +++ b/nb @@ -18828,7 +18828,12 @@ Can't show archives. Export archive and expand to edit.\\n" cat "${_target_path}" } | { if _contains "${_target_extension:-}" "markdown" "md" && - _contains "${NB_MARKDOWN_TOOL:-}" "bat" "glow" "mdcat" "mdless" + _contains "${NB_MARKDOWN_TOOL:-}" \ + "bat" \ + "glow" \ + "mdcat" \ + "mdless" \ + "mdv" then if [[ "${NB_MARKDOWN_TOOL:-}" == "bat" ]] then @@ -18842,6 +18847,9 @@ Can't show archives. Export archive and expand to edit.\\n" elif [[ "${NB_MARKDOWN_TOOL:-}" == "mdless" ]] then mdless + elif [[ "${NB_MARKDOWN_TOOL:-}" == "mdv" ]] + then + mdv "${_target_path}" | _pager fi else {