Skip to content

Instantly share code, notes, and snippets.

@mash
Forked from magnetikonline/README.md
Created July 1, 2016 08:38
Show Gist options
  • Save mash/2282df7de4b04f2076cb1770deb51c7a to your computer and use it in GitHub Desktop.
Save mash/2282df7de4b04f2076cb1770deb51c7a to your computer and use it in GitHub Desktop.
Bookmarklet to pretty print Gist pages without the usual page chrome, just content. Handy for Markdown document printing.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');el.media='print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,.gist-header,.file-header,.gisthead,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Now, cmd+p to print');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
  • Now print
  • Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment