Boost C++ Libraries

PrevUpHomeNext

Simple formatting

Simple markup for formatting text, common in many applications, is now supported:

/italic/, *bold*, _underline_, =teletype=

will generate:

italic, bold, underline, teletype

Unlike QuickBook's standard formatting scheme, the rules for simpler alternatives are much stricter[1].

Table 11.1. More Formatting Samples

Markup

Result

*Bold*

  • Bold*

*Is bold*

  • Is bold*

* Not bold* *Not bold * * Not bold *

  • Not bold* *Not bold * * Not bold *

This*Isn't*Bold (no bold)

This*Isn't*Bold (no bold)

(*Bold Inside*) (parenthesis not bold)

(Bold Inside) (parenthesis not bold)

*(Bold Outside)* (parenthesis bold)

  • (Bold Outside)* (parenthesis bold)

3*4*5 = 60 (no bold)

3*4*5 = 60 (no bold)

3 * 4 * 5 = 60 (no bold)

3 * 4 * 5 = 60 (no bold)

3 *4* 5 = 60 (4 is bold)

3 4 5 = 60 (4 is bold)

*This is bold* this is not *but this is*

  • This is bold* this is not but this is

*This is bold*.

  • This is bold*.

*B*. (bold B)

  • B*. (bold B)

['*Bold-Italic*]

Bold-Italic

*side-by*/-side/

  • side-by*-side

As mentioned, simple markups cannot go past a single block. The text from "have" to "full" in the following paragraph will be rendered as bold:

Baa baa black sheep, *have you any wool?
Yes sir, yes sir, three bags full!*
One for the master, one for the dame,
And one for the little boy who lives down the lane.

Baa baa black sheep, have you any wool? Yes sir, yes sir, three bags full! One for the master, one for the dame, And one for the little boy who lives down the lane.

But in the following paragraph, bold is not applied:

Baa baa black sheep, *have you any wool?
Yes sir, yes sir, three bags full!
One for the master, one for the dame,
And one for the little boy who lives down the lane.

Baa baa black sheep, *have you any wool? Yes sir, yes sir, three bags full! One for the master, one for the dame, And one for the little boy who lives down the lane.



[1] Thanks to David Barrett, author of Qwiki, for sharing these samples and teaching me these obscure formatting rules. I wasn't sure at all if Spirit, being more or less a formal EBNF parser, can handle the context sensitivity and ambiguity.


PrevUpHomeNext