Skip to content

Commit

Permalink
Add support for mdv with $NB_MARKDOWN_TOOL.
Browse files Browse the repository at this point in the history
refs gh-62
  • Loading branch information
xwmx committed Sep 22, 2023
1 parent b9aea4f commit e6a489b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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/)
Expand Down Expand Up @@ -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'
```

<p>
Expand Down
10 changes: 9 additions & 1 deletion nb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down

0 comments on commit e6a489b

Please sign in to comment.