68 points · by flog · 12y ago · 44 comments
I got frustrated with not having a good way to print Markdown files from GitHub (root level repo READMEs and individual .md/mdown files).
It's super simple to use: just replace 'github.com' with 'gitprint.com' (when on a GitHub markdown file page) and it will convert it to a beautiful print-friendly PDF and prompt you to print.
Any feedback would be appreciated. (It's just a fun side project, but would like to improve it as I think it could be useful for like-minded people)
Producer: Qt 4.8.4 (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
Why didn't you use pandoc+latex: $ pandoc -s -S -o gitprint.pdf FILE.mdHowever, a caveat. It is not mentioned in the documentation, but Gitit does not enable PDF export by default, when Pandoc is more than capable of doing so? Why? Because, in all fairness, it can add significant load. According to the conf file comments.
> pdf-export: yes
> # if yes, PDF will appear in export options. PDF will be created using
> # pdflatex, which must be installed and in the path. Note that PDF
> # exports create significant additional server load.
How much load, I am not sure. I would love to see a similar Happstack app like this program that runs gitit or the new fork gitit2, rewritten for Happstack updates now that the API has matured. This makes me think performance is an issue.
As an aside, I know ShareLatex opened up their code. I have not had time to check, but I was curious if they do use standard Latex for generating files and if they do, how they make it performant (I know they have a couple layers, I watched their old Node/JS London talk, I mean hear Latex in particular) so fast for potentially thousands of people at once.
[0] https://gitprint.com/jgm/gitit/blob/master/README.markdown
Is it surprising that processing inline TeX equations or Bibtex citations takes more resources? No.
Compare and Contrast:
Gitprint's pdf of README: https://gitprint.com/jgm/gitit/blob/master/README.markdown
Gitit's html export of README: http://gitit.net/README?printable
If I don't care about the quality of the text layout gitit's printable html page is equivalent to the gitprint pdf. Adding Merriweather to default.html is trivial. But as another commentator pointed out maybe using a new trendy font might not be the best choice if you want decent unicode coverage; just in case one of your users is among the "minority" of people who were unsatisfied by the basic ASCII charset.
Moreover comparing gitprint's markdown support to pandoc as if it is apples to apples is silly.
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd=="loaded"%7C%7Cd=="complete"))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.3.2",function($,L)%7B$('%23header, .pagehead, .breadcrumb, .commit, .meta, %23footer, %23footer-push, .wiki-actions, %23last-edit, .actions, .header,.site-footer,.repository-sidebar,.file-navigation').remove(); $('%23files, .file').css(%7B"background":"none", "border":"none"%7D); $('link').removeAttr('media');%7D);javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd=="loaded"%7C%7Cd=="complete"))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.3.2",function($,L)%7B$('%23header, .pagehead, .breadcrumb, .commit, .meta, %23footer, %23footer-push, .wiki-actions, %23last-edit, .actions, .header,.site-footer,.repository-sidebar,.file-navigation').remove(); $('%23files, .file').css(%7B"background":"none", "border":"none"%7D); $('link').removeAttr('media');%7D);I wish print css was more supported. I'll read blog articles describing my plight, but from 10 years ago. It makes me sad.
i really despise word processors, so i've been building out a jekyll/github pages site with each of my past jobs/projects as small markdown posts with the necessary metadata.
Then on the theme level I pull in the markdown files into a responsive site that degrades down all the way to mobile, and that has a print stylesheet that will generate a presentable resume from all this content.
I never really seem to get to the point of finishing the print stylesheet, because I seem to always find a job before I get to that point.
Still, at least now I can just update some small text files as I continue my career, and ultimately it just feels more sensible for me to manage that data than something like LinkedIn.
I was also thinking about adding some client side filtering of the past projects/jobs based on the technologies I tag them with, so I can generate a customized resume for each position. Maybe if I abstract it out into a separate project ...
There might be some JS hacks that could be done on github.com itself to render a more stylized view when ⌘+P is pressed. Avoiding the need for a special "print this page" button.
javascript:if (location.href.slice(0,18) == "https://github.com" && document.body.classList.contains('page-blob')) location.href = 'https://gitprint.com' + location.href.slice(18)Example: https://gitprint.com/chriscummins/pip-db Image tag: 
Otherwise excellent work.
In Chromium on Linux Mint, it wants to download the PDF file right away (doesn't wait for a button press). And it never actually loads, just keeps showing the loading icon.
(Aprt from that, though, this looks like a handy service :))
- Syntax highlighting on code blocks
- Ability to insert page breaks
Great work!@see https://gitprint.com/reeze/tipi, but Chinese text didn't display correct :(
$ pandoc -o out.pdf README.md