Divisions: How Wikipublisher processes div markup
Floating images and tables are useful, but how do I take a block of regular text out of the main flow?
Book assembly and binding
PmWiki provides a (:div:) … (:divend:) markup block to denote the start and end of an HTML <div>. We often use this feature to apply a special style to a block of text. Wikipublisher takes advantage of this to treat some div blocks as “custom floats” in the typeset version of the page. This gives authors a way to label and separate a block of text from the main flow, like a sidebar. The typical use is for “asides” — explanatory material read in conjunction with, but not as part of, the main body.
A div with a caption will floatThe typesetting rule is the same as for images and simple tables: if the div block has a caption, it floats and the following text flows around it. This is an aside illustrates this — to see how it’s done, look at the page source. We use the same syntax as for tables and add id=uniqueLabel"Caption text" to the div directive. Authors can reference a div block using the DIV(uniqueLabel) syntax. The Div(uniqueLabel) variant is also supported.
This is an aside
Cras ante. Integer rhoncus laoreet orci. Donec dui justo, aliquam vitae, nonummy ut, sollicitudin a, elit. Aliquam erat volutpat. Sed purus. Suspendisse potenti. Aliquam a sem. Nam elementum lacus sed justo. Praesent sed nulla non lorem iaculis pulvinar. Nunc scelerisque rutrum ipsum. Nulla erat libero, consectetuer sed, egestas in, congue sit amet, arcu. Suspendisse consequat eros ut neque. Vestibulum mollis metus et quam. Sed interdum malesuada eros. Suspendisse mattis nonummy felis. Donec lorem est, porta id, placerat in, iaculis in, urna.
4 float styles are availableAuthors have a choice of 4 styles for floating text blocks, controlled through the cfloatstyle metadata type:
Wikipublisher uses shaded as the default, which puts a grey rule between the caption and the float text body. To try the others, press the “options” button and look under “Float settings” for “Custom float style”. When typesetting a trail, authors can include a list of custom floats in the front matter by setting cfloatlist type to on.
Reference advanced tablesAs a side-benefit of adding support for labelled text blocks, authors can now use the same id=label"caption text" technique to add a caption to an advanced (:table:) directive. Authors can then use TAB(label) to reference the table.