[quickbook] template vs block vs phrase issues

Hi, I use quickbook to write software design documentation targeting pdf. We now introduce a requirements tracking system that includes both source code and design documents. To describe or refer to requirements in docbook docments special xml markup is needed. I.e. something like <reqfooo><status>approved</status><version>1</version><id>DoOnlyNeededStuff</id><description></description></regfoo>. Since I do not want to write XML I added quickbook templates: [template reqfoo[id contents]'''<reqcfoo><id>'''[id]'''</id>'''[contents]'''</reqfoo>'''] [template sdesc[contents]'''<shortdesc>'''[contents]'''</shortdesc>'''] [template verification[contents]'''<verifycrit>'''[contents]'''</verifycrit>'''] [template source[contents]'''<source>'''[contents]'''</source>'''] [template usecase[contents]'''<usecase>'''[contents]'''</usecase>'''] [template status[contents]'''<status>'''[contents]'''</status>'''] [template version[contents]'''<version>'''[contents]'''</version>'''] and finally: [template desc[contents]'''<description>'''[contents] '''</description>'''] Now I want to use block elements inside the contents parameter of desc. Is there any way to achieve that? The only thing I can think of is: [template desc[]'''<description>'''] [template enddesc[]'''</description>'''] But then quickbook is just as good as xml! I tried to make desc a block level template by adding a line break at different positions, but then I get broken xml code, since para tags are spread around <description> regards Andreas

On 6 December 2012 13:45, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
Hi, I use quickbook to write software design documentation targeting pdf. We now introduce a requirements tracking system that includes both source code and design documents. To describe or refer to requirements in docbook docments special xml markup is needed. I.e. something like <reqfooo><status>approved</status><version>1</version><id>DoOnlyNeededStuff</id><description></description></regfoo>. Since I do not want to write XML I added quickbook templates:
[template reqfoo[id contents]'''<reqcfoo><id>'''[id]'''</id>'''[contents]'''</reqfoo>'''] [template sdesc[contents]'''<shortdesc>'''[contents]'''</shortdesc>'''] [template verification[contents]'''<verifycrit>'''[contents]'''</verifycrit>'''] [template source[contents]'''<source>'''[contents]'''</source>'''] [template usecase[contents]'''<usecase>'''[contents]'''</usecase>'''] [template status[contents]'''<status>'''[contents]'''</status>'''] [template version[contents]'''<version>'''[contents]'''</version>''']
and finally: [template desc[contents]'''<description>'''[contents] '''</description>''']
Now I want to use block elements inside the contents parameter of desc. Is there any way to achieve that? The only thing I can think of is:
[template desc[]'''<description>'''] [template enddesc[]'''</description>''']
But then quickbook is just as good as xml!
I tried to make desc a block level template by adding a line break at different positions, but then I get broken xml code, since para tags are spread around <description>
I don't think you can with the current quickbook. I started trying to fix this, but never finished it. The following sort of works (by using 'quickbook 1.6' the document opts into the extra experimental features that I added, but I'm not sure if they'll ever be made final). It uses a horrible hack to pass block markup to the template. The problem is that the parser swallows up any whitespace between a template call and its first argument (including newlines), so that the first argument can't be block markup. But the second can if the call uses the '..' separator, so that's why it uses 'x..', 'x' is the first parameter that's ignored. Shouldn't be too hard to implement something better for 1.6. In 'desc' I use the 'block' tag, which is a 1.6 tag that says its contents should be considered block markup and shouldn't be used inside paragraph tags. The name is a bit confusing - it doesn't mean that the contents are quickbook blocks, something like 'not-a-phrase' might be better. [article Blah [quickbook 1.6] ] [template desc[x1 x2] [block '''<description>'''] [x2] [block '''</description>'''] ] [desc x.. Paragraph 1 Paragraph 2 ]

Hi, 2012/12/7 Daniel James <dnljms@gmail.com>:
On 6 December 2012 13:45, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
[article Blah [quickbook 1.6] ]
[template desc[x1 x2] [block '''<description>'''] [x2] [block '''</description>'''] ]
[desc x.. Paragraph 1
Paragraph 2 ]
I tried that with quickbook that was released with boost 1.52 and it complains: @last line of Paragraph1:error: Missing close bracket @the end of desc:error:Mismatched close bracket Or do I need the svn version - the one I use claims to be 1.5.8? regards Andreas

Hi, 2012/12/9 Andreas Pokorny <andreas.pokorny@gmail.com>:
[...]
I tried that with quickbook that was released with boost 1.52 and it complains: @last line of Paragraph1:error: Missing close bracket @the end of desc:error:Mismatched close bracket
Tried a minimal example and it works. Seems like I have still different errors.. coming back when I cleaned up my files. regards andreas

On 9 December 2012 22:01, Andreas Pokorny <andreas.pokorny@gmail.com> wrote:
Hi,
2012/12/9 Andreas Pokorny <andreas.pokorny@gmail.com>:
[...]
I tried that with quickbook that was released with boost 1.52 and it complains: @last line of Paragraph1:error: Missing close bracket @the end of desc:error:Mismatched close bracket
Tried a minimal example and it works. Seems like I have still different errors.. coming back when I cleaned up my files.
1.6 is stricter about square brackets, and a little different to 1.5, so it might be tricky to convert a 1.5 document as is. One thing it can do is include quickbook 1.5 files from quickbook 1.6 files, so you can define the template in a quickbook 1.6 file, and then use it in quickbook 1.5. Start with the quickbook 1.6 file: [article Blah [quickbook 1.6] ] [template desc[x1 x2] [block '''<description>'''] [x2] [block '''</description>'''] ] [include contents.qbk] And then 'contents.qbk' contains: [quickbook 1.5] [desc x.. Paragraph 1 Paragraph 2 ]

On 9 December 2012 22:15, Daniel James <dnljms@gmail.com> wrote:
1.6 is stricter about square brackets, and a little different to 1.5, so it might be tricky to convert a 1.5 document as is. One thing it can do is include quickbook 1.5 files from quickbook 1.6 files, so you can define the template in a quickbook 1.6 file, and then use it in quickbook 1.5.
Oh, it turns out you can include a quickbook 1.6 file from a 1.5 file. Just create a 1.6 file for the template, and use '[include file.qbk]' to include the templates in your file: [quickbook 1.6] [template desc[x1 x2] [block '''<description>'''] [x2] [block '''</description>'''] ]
participants (2)
-
Andreas Pokorny
-
Daniel James