7 [/-------------------------------- nullary arg ]
9 [template foo0 nullary_arg]
13 [/-------------------------------- unary arg, phrase syle ]
15 [template foo1[bar] foo [bar]]
19 [/-------------------------------- unary arg, block syle ]
28 This is a complete paragraph. [bar] [bar] [bar] [bar] [bar]
29 [bar] [bar] [bar] [bar].... blah blah blah......
34 [/-------------------------------- unary arg, using punctuation ]
36 [template ![bar] '''<hey>'''[bar]'''</hey>''']
40 [/-------------------------------- recursive templates ]
48 [template foo5[x] zoom [x]]
49 [template foo6[x] [x] zoom]
53 [template kinda_weird[x y] [x] [y]]
55 [kinda_weird exactly..xanadu]
58 [/-------------------------------- space delimitted args ]
60 [template simple1[a b] [a][b]]
64 [template simple2[a b c d] [a][b][c][d]]
66 [simple2 w x y z][simple2 w x y z trail]
68 [/-------------------------------- John's templates ]
73 std::cout << ``[x]`` << std::endl;
77 [code "Hello\, World"]
79 [template alpha '''α''']
80 [template pow[a b] [a]'''<superscript>'''[b]'''</superscript>''' ]
81 [template super[text]'''<superscript>'''[text]'''</superscript>''' ]
89 [/-------------------------------- Some more ]
91 [template banana got a banana?]
92 [template plantation[bananarama] [bananarama]]
96 [/-------------------------------- Not a bug (there was a syntax error here) ]
98 [template join1[a b] [b][a]]
99 [template join2[a b] [a][b]]
100 [template test[x] [join1 [join2 0 [x]]...0]]
103 [/-------------------------------- Mismatched template ]
112 [section Empty Templates]
116 [template empty3 [/comment]]
117 [template empty4 [/comment]
132 [template empty_arg1[x]]
133 [template empty_arg2[x y]]
148 [/----------------------------------- Nested templates ]
150 [section Nested Templates]
152 [template block_foo[content]
154 Start block template.
161 [template phrase_foo[content] Start phrase template. [content] End phrase template.]
163 Pre [block_foo [block_foo Hello!]] Post
165 Pre [block_foo [phrase_foo Hello!]] Post
167 Pre [phrase_foo [block_foo Hello!]] Post
169 Pre [phrase_foo [phrase_foo Hello!]] Post
173 [/----------------------------------- Block Markup ]
175 [section Block Markup]
193 [list][horizontal][codeblock][paragraphs]
202 [/----------------------------------- 1.5+ use static scoping ]
204 [section Static Scoping]
206 [template x static scoping]
207 [template static_test1[] [x]]
208 [template static_test2[x] [static_test1]]
209 [static_test2 dynamic scoping]
211 [/ This should be '[a]' because [a] isn't matched. ]
212 [template test1[] [a]]
213 [template test2[a] [test1]]
216 [/ In 1.5 template arguments are scoped at the point they are defined]
219 [template static_test3[a y] [a]]
220 [static_test3 [y] old]
222 [/ From https://svn.boost.org/trac/boost/ticket/2034 ]
224 [template same[x] [x]]
225 [template echo[a b] [a] [b]]
226 [template echo_twice[x] [echo [same [x]]..[same [x]]]]
231 [/----------------------------------- 1.5+ template arguments ]
233 [section Template Arguments]
235 [template binary[x y] {[x]-[y]}]
236 [binary 1..2] [/ {1-2} ]
237 [binary 1 2] [/ {1-2} ]
238 [binary 1..2 3 4] [/ {1-2 3 4} ]
239 [binary 1 2..3 4] [/ {1 2-3 4} ]
240 [binary 1 2 3..4] [/ {1 2 3-4} ]
241 [binary 1.\.2..3] [/ {1..2-3} ]
242 [binary 1.\.2 3] [/ {1..2-3} ]
244 [binary [binary 1 2..3]..4] [/ { {1 2-3}-4} ]
245 [binary [binary 1 2..3] 4] [/ { {1 2-3}-4} ]
246 [binary [binary 1 2 3]..4] [/ { {1-2 3}-4} ]
248 [binary \[1 2\] 3] [/ {[1-2] 3} ]
249 [binary \[1..2\] 3] [/ {[1-2] 3} ]
250 [binary \[1 2] [/ {(1-2} ]
252 [template ternary[x y z] {[x]-[y]-[z]}]
253 [ternary 1..2..3] [/ {1-2-3} ]
254 [ternary 1 2 3] [/ {1-2-3} ]
258 [/----------------------------------- Block and phrases ]
260 [section Block and phrase templates]
262 [template phrase_template[] Some *text*]
263 [template block_template[]
265 A <emphasis>paragraph</emphasis>.
273 [/ Trailing newline shouldn't be included]
275 [template named_index[type title]
276 '''<index type="'''[type]'''"><title>'''[title]'''</title></index>'''
279 [named_index things Things]
283 [/-------------------------------- Skipping template body ]
285 [section:template_body Skipping the template body correctly]
287 [template args1[x] [`x]]
289 [ordered_list [``code``]]
291 [/ Due to a bug in the template parser need to stop the parser
292 thinking that the code is an escaped template. ]
294 [ordered_list [\ `code`]]
297 [args1 <emphasis>Argument</emphasis>]
303 [/----------------------------------- Escaped templates ]
305 [section Escaped templates]
307 [template raw_markup <thingbob>Not real boostbook</thingbob>]
308 [template escaped1 [x] [`x]]
311 [escaped1 <thingbob>More fake boostbook</thingbob>]