schacon/git-scribe — pull request #46 by eee-c (2012-08-20 17:49:58+00:00)
Title: PDF Pygments

I realize that this is a big shift, but I thought it worth pinging you on...

I recently got PDF highlights with pygments working. A sample generated with pygments is available at: http://gamingjs.com/building_avatar_sample.pdf

This offers four advantages over the current saxon/xslthl approach:

1. No java. Intrinsic distastes aside, this makes for fewer dependencies (we can also replace source-highlight with pygments).
2. More languages supported. The list of xslthl supported languages is embarrassingly short.
3. Configurable themes. I have hard-coded the "borland" theme, but that could easily become an option.
4. Better page control. This may just be me, but I could not get saxon to generate 9x7.5 inch pages (required by the prags).

Some notes about the implementation: I am decorating both the docbook and XSL-FO outputs on disks. The actual pygmentation reads in the entire XSL-FO document, extracts code snippets, sends them to a `pygmentize` system call, then converts the result to XSL-FO. It's a bit awkward, but it works.

I don't think you want this entire pull request as it has _lots_ of differences - all are improvements, but that's besides the point :P

It would take a lot of effort for me to retrofit my changes back onto upstream at this point. If you're open to shifting back to xsltproc, then I will move forward with getting a series of PRs ready. If not, no worries -- I'm happy to maintain my awesome fork :)

A couple of other notes about that sample PDF: I pulled in admonition icons to make the callouts nicer. I have also added support for nicer fonts.