If I want to print a markdown file from GitHub as it appears on screen, for example: https://github.com/RestKit/RestKit/blob/master/Docs/Object%20Mapping.md
Then how can
Another option is pandoc. After installing (it supports Windows, Linux and Mac OS), the command would be along the lines of
pandoc file.md -f markdown --smart -s -o file.pdf
Then print the resulting PDF file.
There is also this online converter, which produced the nicest output for me: http://www.markdowntopdf.com/
Pandoc has an online demo as well.
Update 2020: on macOS Catalina this command worked for me:
brew cask install basictex
pandoc README.md -f markdown+smart -s -o out.pdf --pdf-engine=/Library/TeX/texbin/pdflatex --pdf-engine=xelatex