Description
I used the 'Render as Docbook' menu item to generate the XML for a page in my local wiki. The page contains {{{#!highlight python... }}} code areas. I save the XML to a file. I try to use dblatex on it to generate a PDF, but the 'language' attribute of the '<programlisting>' tags are set to "highlight" instead of "python". The causes the dblatex step to fail because it does not understand "highlight" as a language.
Steps to reproduce
- Create a page that contains some python code with highlighting turned on.
= Highlight Test = {{{#!highlight python class Foo(): pass }}}
Use the 'Render as Docbook' menu item to generate the XML for the page and save it to a file such as page.xml.
Run dblatex on the file: dblatex -T simple -o page.pdf page.xml
- Note the errors in the output regarding the language
Example
Component selection
- general
Details
MoinMoin Version |
1.9.8 |
OS and Version |
Debian Testing (Debian 8.0) |
Python Version |
2.7.8 |
Server Setup |
Debian Testing (Debian 8.0)/Apache 2 |
Server Details |
Python 2.7.8 |
Language you are using the wiki in (set in the browser/UserPreferences) |
English |
Workaround
I created a bash script that changes language="highlight" to language="python" in the XML using sed and then runs dblatex on the new XML to get a proper PDF.
I also created a Python script which does a similar thing, but works with the XML tree so that it won't change user text that actually contains language="highlight".
Discussion
We have no developer using docbook and working on moin 1.9.x currently, so patches are welcome!
I added a patch to the attachments. The patch was created from the moin-1.9 repository. I tested it with:
{{{#!highlight python
{{{#!highlight c
{{{#!highlight
{{{#!
{{{#!python
They all worked as expected.
Plan
- Priority:
- Assigned to:
- Status: