
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 France License.
After few attempt with cduce, in the end I resorted to xslt to convert the cduce manual to a more drupal-friendly format.
Drupal uses the geshi filter to do syntax highlighting. The problem with this filter is that it does not understand CDATA sections and its input is not well-formed xml.
The cduce manual is written in a well-formed xml and uses CDATA sections for cduce code. For example:
My problem was to remove the cdata declaration and output something of the form:
After a bit of document reading and research this was my solution:
This template is effectively a function that is invoked with two parameters input and mode.
Input contains the text to be printed, while the mode is a boolean to decide whether to encode the input or not. Using <xsl:copy-of ... or xsl:text... with disable-output-escaping does not give the same result.
I'm not sure if this is a bug/feature or xsltproc or something written in the xslt standard.
The function to invoke the above function is as follows:
Recent comments
1 day 3 hours ago
2 weeks 2 days ago
2 weeks 6 days ago
4 weeks 3 days ago
7 weeks 6 days ago
15 weeks 4 days ago
15 weeks 6 days ago
16 weeks 2 days ago
16 weeks 3 days ago
16 weeks 3 days ago