Note that the definitions won't look right in the target output format,
because they contain target markup.
Definitions for DocBook XML.
XML requires well-formed paragraphs, so we have our own paragraph system
here. We put a paragraph inside most everything just to be sure.
Here are the macros to keep the result well-formed.
w_close must be called before emitting any block-level tag. w_open
will open a paragraph, no matter what. w_softopen marks that if there
is text forthcoming, it must be in its own paragraph.
DocBook has its own sectioning system — very structured but poorly
corresponding to traditional typography. (In some ways, a section is a
unit, in others, it is not. For example, a document usually makes
sensible reading if you take away headings, but not always when you
remove some section.)
The macros here are linked to headings: headings produce sections. But
we need to hook closing of sections somewhere. This is done at the
template.
There is no real way to put line breaks into documents in DocBook. We
should wrap the whole paragraph in literal layout, but we can't do that
at this stage, and there might be non-hard line breaks in the same
paragraph. Let's just settle for this ugly hack: