[quickbook] Using .. for content in templates

Hi, We now integrated plantuml into the quickbook / docbook - toolchain. plantuml uses text based inputs to declare UML diagrams. Some of the text markups include "..". For embedding the diagrams directly inside the document source we use: [template plantuml[filename scale text] '''<mediaobject><imageobject><imagedata fileref="'''[filename]'''" sclae="'''[scale]'''"/> </imageobject> <textobject><![CDATA[ @startuml ''' [filename]''' ''' [text] ''' @enduml ]]> </textobject> '''] and just call plantuml on the output of quickbook. So the user calls [plantuml my_diag.svg..60..''' Foo --> Bar Blub ..> Bar '''] An extended variant also combines everything into a docbook figure.. To bypass the issue I now consider splitting up the call into two templates, and not passing the plantuml content through the template calls.. Are there any other solutions possible? regards Andreas

Hi, 2013/1/24 Andreas Pokorny <andreas.pokorny@gmail.com>:
Hi,
We now integrated plantuml into the quickbook / docbook - toolchain. plantuml uses text based inputs to declare UML diagrams.
PS: plantuml uses dot for layout - by running dot with a simplified diagram, parsing the svg result and creating a skinned and beautified svg/png/whatever as output. Given the hack I used in the build system to run plantuml on the intermediate output. It would be nicer if quickbook would provide that by using dots layouting library directly.. Just in case there is some free time to kill.. regards Andreas

On 24 January 2013 15:26, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
Hi,
2013/1/24 Andreas Pokorny <andreas.pokorny@gmail.com>:
Hi,
We now integrated plantuml into the quickbook / docbook - toolchain. plantuml uses text based inputs to declare UML diagrams.
PS: plantuml uses dot for layout - by running dot with a simplified diagram, parsing the svg result and creating a skinned and beautified svg/png/whatever as output. Given the hack I used in the build system to run plantuml on the intermediate output. It would be nicer if quickbook would provide that by using dots layouting library directly.. Just in case there is some free time to kill..
That's probably too much for me. But if anyone wants to integrate their code into quickbook, I might be able to do something. Perhaps we could have a very limited extension system, where a chunk of text is fed through a function, or maybe an executable?

On 24 January 2013 15:15, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
So the user calls [plantuml my_diag.svg..60..''' Foo --> Bar Blub ..> Bar ''']
The normal trick is to escape the second dot, i.e. ".\.", but that won't work here because it's in an escape. So the only thing I can think of is to break the escaped text into two blocks in the middle: [plantuml my_diag.svg..60..''' Foo --> Bar Blub .''''''.> Bar '''] Which is horrible - but it works (although it won't if you turn off pretty printing). Also, since quickbook 1.5, if the .. is inside square brackets it will be ignored, but I can't think of any appropriate tag to use (a template won't work). I'll have a look into making the template argument parsing a bit smarter. Quickbook should ignore an ".." if it appears in the middle of escaped content.

Hi 2013/1/24 Daniel James <dnljms@gmail.com>:
On 24 January 2013 15:15, Andreas Pokorny <andreas.pokorny@gmail.com> wrote: Which is horrible - but it works (although it won't if you turn off pretty printing). Also, since quickbook 1.5, if the .. is inside square brackets it will be ignored, but I can't think of any appropriate tag to use (a template won't work).
I tried to split it up into two templates, but then quickbook stumbles over the opening [ in CDATA on the first template, and the same happens with ] in the second template. It seems to match try to match [] within ''''. I gues this is the same issue as with .. within ''' regards Andreas

On 24 January 2013 17:15, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
Hi
2013/1/24 Daniel James <dnljms@gmail.com>:
On 24 January 2013 15:15, Andreas Pokorny <andreas.pokorny@gmail.com> wrote: Which is horrible - but it works (although it won't if you turn off pretty printing). Also, since quickbook 1.5, if the .. is inside square brackets it will be ignored, but I can't think of any appropriate tag to use (a template won't work).
I tried to split it up into two templates, but then quickbook stumbles over the opening [ in CDATA on the first template, and the same happens with ] in the second template. It seems to match try to match [] within ''''. I gues this is the same issue as with .. within '''
Yes. The attached patch is a quick attempt at fixing both issues for quickbook 1.6.

On 24 January 2013 15:44, Daniel James <dnljms@gmail.com> wrote:
The normal trick is to escape the second dot, i.e. ".\.", but that won't work here because it's in an escape. So the only thing I can think of is to break the escaped text into two blocks in the middle:
I didn't mean 'blocks' there. Just two consecutive escaped strings.
[plantuml my_diag.svg..60..''' Foo --> Bar Blub .''''''.> Bar ''']
participants (2)
-
Andreas Pokorny
-
Daniel James