I often want to read Markdown documentation on Github — or proof-read my own documents — without staring at a backlit screen. Here's an easy way to print the files in a readable format.
-
Create a bookmarklet with the following code and give it the name "github print"
javascript:void function(){b=document.body,c=document.querySelector("article"),b.innerHTML="",b.appendChild(c)}();
-
Go to the markdown view on Github of the file you want to print, e.g. Ripgrep's user guide
-
Click on the bookmarklet. Alternatively (in Chrome) type "github print" in the search bar, select the bookmarklet code with cursor keys if necessary and press enter.
-
Use the browser print feature to print the document, to a physical printer or (to save paper) to PDF on a reMarkable eInk tablet.
This bookmarklet, which works with private and public repositories and even gists like this one, will remove all the user interface and leave you only with the content.
This is what the printed output looks like