Skip to content

Instantly share code, notes, and snippets.

@damc-dev
Forked from magnetikonline/README.md
Created November 6, 2015 14:57
Show Gist options
  • Save damc-dev/c726aac0af6fb4fdebbb to your computer and use it in GitHub Desktop.
Save damc-dev/c726aac0af6fb4fdebbb 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,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • 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