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
clone the repo
gem install bluecloth
http://deveiate.org/projects/BlueCloth
you can find examples of the api here: http://deveiate.org/projects/BlueCloth/browser/spec/bluecloth_spec.rb
http://github.com/github/markup
You don't mention a language preference, but this is the Ruby library GitHub itself uses to render the markup files. It has the advantage of supporting the various markups GitHub supports (textile, rdoc etc). Rendering .markdown files has a dependency on the redcarpet markdown parser:
http://github.com/tanoku/redcarpet
I used MarkdownPad and printed the HTML to a PDF writer. If you have Pro you can export to PDF directly.
Simple Hack:
I've been opening the markdown file in something like Marked or the online tool Dillinger and then print from there. Some of these tools allow you to set the formatting to Github or other styles.
A better way:
Since I first wrote the above answer I found a better way:
I've discovered a better way than what I said earlier.
Use gitbook & Calibre's ebook-convert to generate the PDF as per the instructions in https://github.com/GitbookIO/gitbook
ln -s /Applications/calibre.app/Contents/console.app/Contents/MacOS/ebook-convert /usr/local/bin
Try grip.
pip install grip
grip markdown.md
Then it is hosted on a local port. You can then print or save to PDF through your native OS print dialog from your favourite browser.
See here.
Simply convert MD file into PDF
You may download your .md file and upload it here to convert it into a pdf file. Which you can easily print.