Either you’ve already heard of pandoc or if you have searched online for markdown to pdf or similar, you are sure to come across pandoc. This tutorial will give you a basic idea of using pandoc to generate pdf from GitHub style markdown file. The main purpose is to highlight what customizations I did to generate pdf for self-publishing my ebooks. It wasn’t easy to arrive at the set-up I ended up with, so I hope this will be useful for those looking to use pandoc to generate pdf. Specifically aimed at technical books that has code snippets.
Markdeep is a technology for writing plain text documents that will look good in any web browser, whether local or remote. It supports diagrams, calendars, equations, and other features as extensions of Markdown syntax.
- Copy contents of raw .md file, having embedded links to images
- Modify image links in file with following (in Sublime Text 2):
- Find Regex: https://github.com/(.*)/blob/(.*)
- Replace: https://raw.githubusercontent.com/$1/$2
- Paste and 'Convert to HTML page'
- Use browser print to save as PDF
This works for printing Github Markdown with images !
Steps:
1. Download raw .md file, having embedded links to images and copy its contents
2. Modify image links in file with following:
Find Regex: https://github.com/(.*)/blob/(.*)
Replace: https://raw.githubusercontent.com/$1/$2
3. Paste at 'markdownprint' site
4. Generate HTML page
5. Use browser print to save as PDF