Viewing a markdown file in the terminal
Use lowdown
to mark the file up appropriately,
and pass it to less -R
, which supports ANSI colour codes:
mdview () { lowdown -tterm $1 | less -R ; }
mdview README.md
As a fish alias (save to ~/.config/fish/functions/mdview.fish
):
function mdview --wraps='lowdown' --description 'View a markdown file'
lowdown -tterm $argv[1] | less -R
end
This invocation is straight from the lowdown(1) manual.