[pmwiki-users] Code highlighter works with WikiPublisher
john.rankin at affinity.co.nz
Thu Sep 28 00:53:37 CDT 2006
On Sunday, 24 September 2006 4:17 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Fri, Sep 22, 2006 at 05:43:26PM -0800, Joshua J. Kugler wrote:
>> After trying Beautifier and SourceBlock, I have found that neither one
>> of them will work with WikiPublisher. [...]
>> Does anyone have a Syntax highlighter that will produce output
>> compatible with WikiPublisher? Anyone willing to write one?
>I think the issue here is that this is trying to combine two
>different products with incompatible goals.
>The beautifier recipes such as SourceBlock and Beautifier
>are based on third-party packages (beautifier and GeSHi) that
>are really designed to beautify source code using HTML.
>Re-using these packages is nice because the recipe author doesn't
>build or maintain those capabilities, but it's pretty unlikely to
>find an existing package that beautifies source code into
>wiki markup "out of the box".
>Of course, WikiPublisher is designed to go from wiki markup to
>PDF without any intermediate HTML step, so there's not an obvious
>hook for the beautifier recipes as they exist. As I see it,
>this leaves the following options:
It turns out that the wikipublisher pdf server already supports
code beautification -- or rather the wonderful LaTeX listings
package does and the wikibook xml processor has support for this
So, it was a trivial matter to add a markup rule that turns
(source lang=... :) ... (:sourceend:)
'<tbook:verbatim class="..." >'.Keep(PSS('...')).'</tbook:verbatim>'
This works beautifully on our test server, but for some reason
the hosted wikipublisher service dies when it hits the listings
LaTeX code. I don't know why yet.
The test pdf looks great!
Thanks to Nils for the pointer to listings.
More information about the pmwiki-users