Re: [Boost-docs] [quickbook] Macros and scoping

Subject: Re: [Boost-docs] [quickbook] Macros and scoping
From: Stjepan Rajko (stipe_at_[hidden])
Date: 2007-07-30 01:38:38


On 7/29/07, Joel de Guzman <joel_at_[hidden]> wrote:
> Stjepan Rajko wrote:
> >
> > This sounds great to me. One question - are the template/macro
> > definitions going to be usable "retroactively" within the appropriate
> > scope? What I mean is, if:
> >
> > [...]
>
> Oh my, sorry, no. That would require a 2-pass parser. Can't you just
> include file_with_some_templates.qbk from subsection.qbk to make
> sure it's included before use?
>

:-) I think it would also cause some problems to consider with
conditional macros/templates. I realized that after I sent the
mail...

> > This would be useful if one wanted to define templates that link to
> > different section content in the same file as the the section content
> > (but outside the [section], of course), and had two sections that
> > cross-referenced each other. I imagine this is the behavior you
> > envisioned but just making sure.
>
> I'm not sure I get the picture. Could you provide a simple example?
>

What I was thinking of is localizing the usual link templates/macros
to the file that holds their content. Something like:

fileA.qbk

[template thing1[] [link project.sectiona.thing1 thing1]]
[/ ...]

[section sectiona]

[section thing1]
You might also want to check out [thing2]

[endsect]

[/...]

[endsect]

fileB.qbk

[template thing2[] [link project.sectionb.thing2 thing2]]
[/ ...]

[section sectionb]

[section thing2]
You might also want to check out [thing1]

[endsect]

[/...]

[endsect]

mainfile.qbk
[/ define project etc.]

[/ no huge list of all link templates]

[include fileA.qbk]
[include fileB.qbk]

That's what I was picturing... it was just an idea - anyway if I
really wanted to have the links more organized I could do:

mainfile.qbk

[include fileA_links.qbk]
[include fileB_links.qbk]

[include fileA_content.qbk]
[include fileB_content.qbk]

Sorry I wasn't clear - no big deal in any case.

Regards,

Stjepan


This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC