How to print from GitHub
Here's a super simple solution: Simply select all the text in the readme that you want to print, then print and choose "Only selected text".
This worked perfectly in Chrome (including images) and required no javascript or external sites or downloading or building software.
This is what I tested on: https://github.com/kroitor/gjk.c/blob/master/README.md
Here is a bookmarklet that works for me:
- Copy the contents of the bookmarklet Gist, reproduced below as a backup.
- Create a new bookmark in the toolbar of your browser, give it a fitting name.
- Put that one line of code in the URL field.
If you now go to a Markdown page on Github and click the bookmark it will reformat the page and change the CSS so that it looks the same as on screen when you print. It will also automaticaly trigger the printing dialog to pop up.
Bookmarklet contents:
javascript:document.body.appendChild(document.querySelector("#readme"));document.querySelector("header").remove();document.querySelector(".application-main").remove();document.querySelector("footer").remove();window.print();