I have a Markdown string in JavaScript, and I\'d like to display it (with bolding, etc) in a less
(or, I suppose, more
)-style viewer for the comman
I wrote a couple functions based on Keith's answer:
mdt() {
markdown "$*" | lynx -stdin
}
mdb() {
local TMPFILE=$(mktemp)
markdown "$*" > $TMPFILE && ( xdg-open $TMPFILE > /dev/null 2>&1 & )
}
If you're using zsh
, just place those two functions in ~/.zshrc
and then call them from your terminal like
mdt README.md
mdb README.md
"t" is for "terminal", "b" is for browser.