5 ms·
Here's the snippet I'm using: markdown () { pandoc $1 | lynx -stdin } usage: $ markdown README.md I don't often use pandoc or lynx so mig
by rpastuszak 4y ago
Here's the snippet I'm using:
markdown () {
pandoc $1 | lynx -stdin
}
usage:
$ markdown README.md
I don't often use pandoc or lynx so might check out glow instead, but I thought some of you might find this approach simpler in case you already have these tools installed.
- xcdzvyn 4y agoBut it doesn't have pizzazz! :-)
- aaws11 4y agocheeky chooky
- version_five 4y agoHey, you reminded me, I once experimented with pandoc's conversion script- you can write a lua script that handles the different markdown styles - to just output escape sequences for different colors or bold/italics depending on the header level, so that you could just translate the markdown into something prettier in your shell. Your approach is more sensible, I had fun playing with the lua script though. Pandoc will spit out a reference script that formats the output as html so it it pretty easy to work off of
- luckman212 4y agoYou need quotes around "$1" otherwise `markdown "my file.md"` won't work because of the whitespace.
- rpastuszak 4y agoah, good catch, cheers!
- tempodox 4y agoAnd you could swap pandoc with multimarkdown. Achieves the same.