Skip to main content

Pretty Print Github Markdown

Published: 2019-02-11 • Last updated: 2021-05-03

If you want to pretty print your markdown docs in GitHub (GH), and your repo lives on the official, then you can use gitprint. But at work our GH is hosted internally, so this gitprint service does not work.

So, I made my own. It grabs the div that contains the markdown doc (which from what I’ve seen always has an id of readme), clears the body, appends said div, then creates and appends a style to remove anchor coloring.

To use it, (1) copy the below code:


var readme = document.getElementById("readme");
document.body.innerHTML = "";

var style = document.createElement("style");
style.innerHTML = "a { color: inherit; }";


(2) Create a new bookmark, then (3) paste the above code into the URL line:

Google Chrome bookmark