Skip to content

Instantly share code, notes, and snippets.

@pesterhazy
Last active Aug 13, 2021
Embed
What would you like to do?
Print Github Markdown

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.

  1. 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)}();
    
  2. Go to the markdown view on Github of the file you want to print, e.g. Ripgrep's user guide

  3. 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.

  4. 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.

@pesterhazy

This comment has been minimized.

Copy link
Owner Author

@pesterhazy pesterhazy commented Aug 13, 2021

This is what the printed output looks like

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment