As a fun exercise, you should checkout the Gitit README[0], which is a cool VCS-managed wiki that renders everything via Pandoc, using this Gitprint service. Or not. I see you or someone else constantly retorting with "Why not Pandoc?" and I agree with you. I started to get interest in Haskell again just because Pandoc, and Gitit, and some other very impressive stuff, is written in Haskell and seems to do some stuff very powerfully.
However, 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