I realize that I'm more-and-more using cat to look at Markdown files. This means the files are sometimes poorly formatted and have a lot of extra Markdown specifics included. I decided to do a simple shell function to create a markdown cat (mdcat). To create this I rely on two programs: markdown (I use the one from discount, though any program that takes in a files as arguments and outputs HTML should work) and html2text. The function ends up being extremely short:
cat $* | markdown | html2text
mdcat $* | more
mdcat $* | less
That's right, one line is all that's needed. So this ends up being a convenience function to save me typing more than anything else.
Limitations (see below)
It's worth noting that this isn't exactly ideal. Piping into mdcat doesn't work, for instance. So things like this that you'd expect to work don't.
grep "Some text" README.md | mdcat
Thanks to @cbojar for the suggestion which removes the limitation I had above. Also, thanks to @kloetzl on Twitter for pointing out the shortened version of mdcat.
Like most things, this isn't the only way. Another way this could also be accomplished is using pandoc and a shell alias:
alias mdcat="pandoc -f markdown -t plain"