Skip to content

Update markdown tool handling #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions nb
Original file line number Diff line number Diff line change
Expand Up @@ -19210,25 +19210,14 @@ Can't show archives. Export archive and expand to edit.\\n"
"mdless" \
"mdv"
then
if [[ "${_markdown_tool:-}" == "bat" ]]
then
bat --language "${_target_extension:-md}"
elif [[ "${_markdown_tool:-}" == "glow" ]]
then
glow --pager
elif [[ "${_markdown_tool:-}" == "lowdown" ]]
then
lowdown -Tterm | _pager
elif [[ "${_markdown_tool:-}" == "mdcat" ]]
then
mdcat --paginate
elif [[ "${_markdown_tool:-}" == "mdless" ]]
then
mdless
elif [[ "${_markdown_tool:-}" == "mdv" ]]
then
mdv "${_target_path}" | _pager
fi
case "${_markdown_tool:-}" in
"bat") bat --language "${_target_extension:-md}" ;;
"glow") glow --pager ;;
"lowdown") COLS=$(tput cols); lowdown -Tterm --term-width="$COLS" --term-columns="$COLS" --term-hmargin=1 | _pager ;;
"mdcat") mdcat --paginate ;;
"mdless") mdless ;;
"mdv") mdv "${_target_path}" | _pager ;;
esac
else
{
# fold to current terminal width and preserve list formatting
Expand Down
Loading