source: wikiextrasplugin/trunk/tracwikiextras/doc/WikiBoxes

Last change on this file was 10367, checked in by Mikael Relbe, 12 years ago

WikiExtrasPlugin/0.13.2dev: documentation updated for Trac 0.13dev r10730 (no functional change)

Trac 0.13dev r10729-30 introduced wiki processor flags, which the box-processors in this plugin were already adapted for in r10348.

To use this plugin according to built in instructions, Trac 0.13dev r10730 is required.

File size: 6.5 KB
RevLine 
[10273]1= Wiki Boxes
2[[PageOutline(2-3, Content)]]
3
4To highlight a section on a wiki page, use the `box`, `rbox`, `newsbox` and
5`imagebox` WikiProcessors:
6
7{{{
[10367]8{{{#!box type align=... width=...
[10273]9...
10}}}
11
[10367]12{{{#!rbox type width=...
[10273]13...
14}}}
15
16{{{#!newsbox
17...
18}}}
19
20{{{#!imagebox
21...
22}}}
23}}}
24
[10367]25For shorter content, macro syntax may be preferable:
26{{{
27[[box(..., type=..., align=..., width=...)]]
28
29[[rbox(..., type=..., width=...)]]
30
31[[newsbox(...)]]
32
33[[imagebox(...)]]
34}}}
35
[10273]36Following sections demonstrates each box and how to use the  parameters.
37
38
39== box and rbox
40
41The normal `box` looks like this, and is as wide as the page.
42
43{{{#!box
44= box
45This is a normal box.
46== Subheading
47Some text
48= Second Heading 1
49Some text
50}}}
51
52{{{
53{{{#!box
54= box
55This is a normal box.
56== Subheading
57Some text
58= Second Heading 1
59Some text
60}}}
61}}}
62
63An `rbox` is aligned to the right of the page, with a fixed width.
64
65{{{#!rbox
66= rbox
67An `rbox` is aligned to the right of the page, with a
68fixed with. Use this for side notes, references etc.
69}}}
70
71{{{
72{{{#!rbox
73= rbox
74An `rbox` is aligned to the right of the page, with a
75fixed with. Use this for side notes, references etc.
76}}}
77}}}
78
79
[10349]80=== Box types
[10367]81The box type can optionally be stated, either as a flag or as a parameter
82`type=...`. Here are all box types demonstrated. When `box` and `rbox`
83co-exist, they will share the page width.
[10273]84
85
[10367]86{{{#!rbox configure style="margin-top:0"
[10273]87= configure, configuration, tool
[10349]88This box is created by the wiki markup
89{{{
[10367]90{{{#!rbox configure
[10349]91...
[10273]92}}}
[10349]93}}}
[10367]94See the box description to the left for more details.
[10349]95}}}
96
[10367]97{{{#!rbox details
[10349]98= details, look, magnifier
[10273]99}}}
100
[10367]101{{{#!rbox stop
[10273]102= critical, stop
103}}}
[10349]104
[10367]105{{{#!rbox warning
[10273]106= bug, error, important, warning
107}}}
108
[10367]109{{{#!rbox information
[10273]110= information, note
111}}}
[10349]112
[10367]113{{{#!rbox question
[10273]114= help, question
115}}}
[10349]116
[10367]117{{{#!rbox tips
[10273]118= tips
119}}}
120
[10367]121{{{#!rbox comment
[10273]122= comment
123}}}
[10349]124
[10367]125{{{#!rbox discussion
[10273]126= chat, discussion, talk
127}}}
[10349]128
[10367]129{{{#!rbox yes
[10273]130= ok, good, yes
131}}}
[10349]132
[10367]133{{{#!rbox no
[10273]134= bad, no, nok
135}}}
136
137
[10367]138{{{#!box configure style="margin-top:0"
[10273]139= configure, configuration, tool
[10349]140White boxes are part of the normal content.
[10273]141
[10349]142This box is created by the wiki markup
143{{{
[10367]144{{{#!box configure
145...
146}}}
147}}}
148or
149{{{
[10349]150{{{#!box type=configure
151...
[10273]152}}}
[10349]153}}}
154Alternatively, `configuration` or `tool` may be used too, as well as a unique
155abbreviation like `config`.
156}}}
157
[10367]158{{{#!box details
[10349]159= details, look, magnifier
[10273]160}}}
161
[10367]162{{{#!box stop
[10273]163= critical, stop
164Red boxes contain some really important information! Pay close attention to
165these to avoid running into problems.
166}}}
[10349]167
[10367]168{{{#!box warning
[10273]169= bug, error, important, warning
170}}}
171
[10367]172{{{#!box information
[10273]173= information, note
174Yellow boxes contain essential, but not critical information.
175}}}
[10349]176
[10367]177{{{#!box question
[10273]178= help, question
179}}}
[10349]180
[10367]181{{{#!box tips
[10273]182= tips
183}}}
184
[10367]185{{{#!box comment
[10273]186= comment
[10349]187Blue boxes contain elaborative information; they are used to elaborate on-going
[10273]188work and should not, ideally, be left behind when work is done.
189}}}
[10349]190
[10367]191{{{#!box discussion
[10273]192= chat, discussion, talk
193}}}
[10349]194
[10367]195{{{#!box yes
[10273]196= ok, good, yes
197}}}
[10349]198
[10367]199{{{#!box no
[10273]200= bad, no, nok
201}}}
202
203
204=== Specify width
205Use the `width` parameter to set the width of the box:
206
207{{{#!box width=6em
208Small box
209}}}
210
211{{{
212{{{#!box width=6em
213Small box
214}}}
215}}}
216
217Use `width=auto` to auto-size right-aligned boxes:
218{{{#!rbox width=auto
219Auto-sized rbox
220}}}
221{{{
222{{{#!rbox width=auto
223Auto-sized rbox
224}}}
225}}}
226(`width=auto` does not have this effect on `box` since this is the default
227width for it, which is the whole page width.)
228
229
230=== Center-aligned box
231
232Boxes can be center-aligned too. Default width is always `auto`, which causes
233the box to become as narrow as possible.
234
235{{{#!box align=center
236Center-aligned box
237}}}
238
239{{{
240{{{#!box align=center
241Center-aligned box
242}}}
243}}}
244
245Define `width`, or apply a custom style, for widening the centered box.
246
247Width:
248
249{{{#!box align=center width=14em
250Center-aligned box with defined width
251}}}
252
253{{{
254{{{#!box align=center width=14em
255Center-aligned box with defined width
256}}}
257}}}
258
259Custom style:
260
261{{{#!box align=center style="white-space:nowrap"
262Center-aligned box with no white space\\
263wrapping
264}}}
265
266{{{
267{{{#!box align=center style="white-space:nowrap"
268Center-aligned box with no white space\\
269wrapping
270}}}
271}}}
272
273
274=== Left-aligned box
275
276{{{#!box align=left
277Left-aligned box
278}}}
279
280Boxes can be left-aligned too, text will flow to the right of it. The width
281will adapt to its content (i.e. default width is `auto`).
282
283{{{
284{{{#!box align=left
285Left-aligned box
286}}}
287}}}
288
289
290=== Custom styling
291{{{
292#!box type=config style="background-color:white; border:2pt inset gray; max-width:350px; border-radius:0; box-shadow:none"
293= Customizable
294You can also apply some custom styling to text boxes.
295}}}
296
297{{{
298{{{
299#!box type=config style="background-color:white; border:2pt inset gray; max-width:350px; border-radius:0; box-shadow:none"
300= Customizable
301You can also apply some custom styling to text boxes.
302}}}
303}}}
304
305
306== newsbox
307
308A newsbox is very simple to use.
309
310{{{#!newsbox
311= Headline
312A `newsbox` is aligned to the right of the page,
313with a fixed with. Use this for announcements etc.
314}}}
315
316{{{
317{{{#!newsbox
318= Headline
319A `newsbox` is aligned to the right of the page,
320with a fixed with. Use this for announcements etc.
321}}}
322}}}
323
[10367]324A newsbox accepts the same parameters as an ordinary box, but are normally not
325used.
[10273]326
[10367]327
[10273]328== imagebox
329
330Use the `imagebox` to show a single image with caption.
331
332{{{#!imagebox
333[[Image(htdocs:../common/guide/original-workflow.png, border=1, link=)]]
334
335Original ticket workflow
336}}}
337
338{{{
339{{{#!imagebox
340[[Image(htdocs:../common/guide/original-workflow.png, border=1, link=)]]
341
342Original ticket workflow
343}}}
344}}}
345
[10367]346An imagebox accepts the same parameters as an ordinary box, but are normally
347not used.
[10273]348
[10367]349
[10349]350== Macro syntax examples
351The macro syntax may be preferable for shorter content:
352
[10350]353[[rbox(A short comment)]]
[10349]354{{{
[10350]355[[rbox(A short comment)]]
[10349]356}}}
357
358The type can be set as a parameter:
[10350]359[[rbox(A short comment, type=comment)]]
[10349]360{{{
[10350]361[[rbox(A short comment, type=comment)]]
[10349]362}}}
363
364Alignment too:
365{{{
[10350]366[[box(Learn how to use boxes, align=center)]]
[10349]367}}}
[10350]368[[box(Learn how to use boxes, align=center)]]
[10349]369
[10367]370Finally, width as well:
371[[rbox(Auto-sized rbox, width=auto)]]
372{{{
373[[rbox(Auto-sized rbox, width=auto)]]
374}}}
[10349]375
[10367]376
[10273]377== Macro instructions
378Here follows the built in macro instructions concerning boxes, as they appear
379on WikiMacros.
380
381[[box?]]
Note: See TracBrowser for help on using the repository browser.