quickbook equivalent of <simplesect>?
Does Quickbook support <simplesect> or an equivalent? This is useful for the 'Authors' sections in Core, which don't need to clutter the ToC.
On 10 June 2014 15:07, Peter Dimov
Does Quickbook support <simplesect> or an equivalent? This is useful for the 'Authors' sections in Core, which don't need to clutter the ToC.
Not built in, but you can use templates: [template simplesect[title] [block '''<simplesect><title>'''[title]'''</title>''']] [template endsimplesect[] [block '''</simplesect>''']] [simplesect Authors] Content.... [endsimplesect]
Daniel James wrote:
On 10 June 2014 15:07, Peter Dimov
wrote: Does Quickbook support <simplesect> or an equivalent? This is useful for the 'Authors' sections in Core, which don't need to clutter the ToC.
Not built in, but you can use templates:
[template simplesect[title] [block '''<simplesect><title>'''[title]'''</title>''']]
[template endsimplesect[] [block '''</simplesect>''']]
Very nice! What are the best practices of defining templates in .qbk files that are part of the combined documentation build? Are the templates local to their file?
On 10 June 2014 15:33, Peter Dimov
Very nice!
What are the best practices of defining templates in .qbk files that are part of the combined documentation build? Are the templates local to their file?
Since the different libraries' documentation is translated to boostbook separately templates can't affect other libraries, so you don't have to worry about that. The rules for templates depend on the quickbook version of your document, for older versions of quickbook templates are defined globally, in 1.6 templates are scoped to the file they were defined in. In 1.6 they can be imported from another file using [import file.qbk], so that it's still possible to create a template library file.
On 10 June 2014 15:44, Daniel James
The rules for templates depend on the quickbook version of your document, for older versions of quickbook templates are defined globally, in 1.6 templates are scoped to the file they were defined in.
That's not quite right, in the implementation a file scope means a file plus any included files, but that's not what most people would think of as 'scoped to the file'. So, I should have said, they're available in the file they were defined in/imported into, and any files included after that.
Daniel James wrote:
[template simplesect[title] [block '''<simplesect><title>'''[title]'''</title>''']]
[template endsimplesect[] [block '''</simplesect>''']]
[simplesect Authors]
Content....
[endsimplesect]
Doesn't seem to work, unfortunately. This: [simplesect Authors] * Brad King * Douglas Gregor * Peter Dimov [endsimplesect] produces the following XML: <para> [block <simplesect><title>Authors</title>] </para> <itemizedlist> <listitem> <simpara> Brad King </simpara> </listitem> <listitem> <simpara> Douglas Gregor </simpara> </listitem> <listitem> <simpara> Peter Dimov </simpara> </listitem> </itemizedlist> <para> [block </simplesect>] </para> I've tried fiddling around with the template definitions, but all my attempts have made matters worse. :-)
On 10 June 2014 16:00, Peter Dimov
Daniel James wrote:
[template simplesect[title] [block '''<simplesect><title>'''[title]'''</title>''']]
[template endsimplesect[] [block '''</simplesect>''']]
[simplesect Authors]
Content....
[endsimplesect]
Doesn't seem to work, unfortunately.
Sorry, you have to be using the '[quickbook 1.6]' tag in your docinfo, core is currently using '[quickbook 1.5]'. I just tried changing it and scoped_enum.qbk had an error, which can be fixed by putting [quickbook 1.5] at the top of the file, so that quickbook will treat it as a 1.5 file (1.6 is a bit stricter). The reason for the error is a bit awkward, the documentation contains what 1.5 interprets as a code block after a list, which is probably meant to be a code block in a list, which 1.6 detects but can't deal with. 1.7 will fix this, it should be released in boost 1.57.
Daniel James wrote:
Sorry, you have to be using the '[quickbook 1.6]' tag in your docinfo, core is currently using '[quickbook 1.5]'. I just tried changing it and scoped_enum.qbk had an error, which can be fixed by putting [quickbook 1.5] at the top of the file, so that quickbook will treat it as a 1.5 file (1.6 is a bit stricter).
That worked, thanks. Except that now enable_if complains: Error: no ID for constraint linkend: core.enable_if.using_enable_if.enable_if_lazy. Error: no ID for constraint linkend: core.enable_if.using_enable_if.enable_if_0x. and I'm not sure what it doesn't like.
On 10 June 2014 16:39, Peter Dimov
Daniel James wrote:
Sorry, you have to be using the '[quickbook 1.6]' tag in your docinfo, core is currently using '[quickbook 1.5]'. I just tried changing it and scoped_enum.qbk had an error, which can be fixed by putting [quickbook 1.5] at the top of the file, so that quickbook will treat it as a 1.5 file (1.6 is a bit stricter).
That worked, thanks. Except that now enable_if complains:
Error: no ID for constraint linkend: core.enable_if.using_enable_if.enable_if_lazy. Error: no ID for constraint linkend: core.enable_if.using_enable_if.enable_if_0x.
and I'm not sure what it doesn't like.
Sorry, it's the 'include:core' tags. What they do is set the id for included file, 1.6 detects id collisions and renames them, in this case it's creating a new id for every included file. If I'd forseen that, I could have had a special case. I imagine they're there to override the id generator, because older versions of quickbook had a bug for included files (which I had to remain compatible with in order to avoid breaking existing documentation). You can either change them to plain include tags (i.e. remote the ':core' part), or add '[compatibility-mode 1.5]' after the [quickbook 1.6] tag.
participants (2)
-
Daniel James
-
Peter Dimov