David Abrahams wrote:
> David Abrahams <[EMAIL PROTECTED]> writes:
> 
>> I'm not really clear on what block-level formatting means.  If
>> [document ] is a block-level element, I presume [copyright ... ] is
>> also, but QBK doesn't preserve paragraph breaks in my copyright.
> 
> IIUC, paragraphs are blocks, and so is [pre ... ].  Does that mean I
> can't have a [pre ... ] construct inside a paragraph?
> 
> Actually, the QB docs say that blocks and phrases can contain phrases
> and that phrases can't contain blocks, but they don't say whether
> blocks can contain blocks.
> 
> It appears, from my experiments, that they cannot.
> 
> I find it strange that I can embed a code block in a paragraph but not
> a [pre ...] block.

Here's a simplified grammar:

(stripped off a lot of things for clarity.
emphasizing on a particular phrase markup: bold)

     start = +block;
     block = +phrase;
     phrase = *phrase_markup;

     phrase_markup =
             '['
         >>  (   image
             |   bold
             |   /*...*/
             )
         >>  ']'
         ;

     bold = '*' >> phrase;

It is hierarchical. Blocks contain one or more phrases.
Phrases can contain other phrases. But phrases cannot
contain blocks.

One reason is simply for syntactical considerations. It is
possible for some well-formed (unambiguous) block-level
elements to be moved to phrase-level. An example is the
table. The table syntax is well behaved and can be nested.
(its original (QuickDoc; pre-Quickbook) syntax was not).
Paragraphs are not quite well behaved; they do not have
markups at all. You don't know where they start and end,
for instance. Lists are also not well behaved.

Another reason is, of course, structuring. It does not make
sense to have a bold ([*some text]) contain a section, for
example.

It is interesting to note that this strict hierarchy can be
overcome by templates. For example:

     [template para[body]
     body
     ]

is a block-structured template. With this simple template, you
can put a well behaved, properly marked-up paragraph inside your
phrases. Example:

     [table
     [[para[
     A bone fragment that scientists had initially ignored has
     begun to yield secrets of the Neanderthal genome, launching
     a new way to learn about the stocky and muscular relative
     of modern humans, scientists say.

     Genetic material from the bone has let researchers identify
     more than a million building blocks of Neanderthal DNA so far,
     and it should be enough to derive most of the creature's 3.3
     billion blocks within the next two years, said researcher
     Svante Paabo.
     ]]
     [column2]
     [column3]]
     ]

(untested, but this should work (disregarding potential
template bugs. Template are a fairly new feature).

Regards,
-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to