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
Line 
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{{{
8{{{#!box type align=... width=...
9...
10}}}
11
12{{{#!rbox type width=...
13...
14}}}
15
16{{{#!newsbox
17...
18}}}
19
20{{{#!imagebox
21...
22}}}
23}}}
24
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
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
80=== Box types
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.
84
85
86{{{#!rbox configure style="margin-top:0"
87= configure, configuration, tool
88This box is created by the wiki markup
89{{{
90{{{#!rbox configure
91...
92}}}
93}}}
94See the box description to the left for more details.
95}}}
96
97{{{#!rbox details
98= details, look, magnifier
99}}}
100
101{{{#!rbox stop
102= critical, stop
103}}}
104
105{{{#!rbox warning
106= bug, error, important, warning
107}}}
108
109{{{#!rbox information
110= information, note
111}}}
112
113{{{#!rbox question
114= help, question
115}}}
116
117{{{#!rbox tips
118= tips
119}}}
120
121{{{#!rbox comment
122= comment
123}}}
124
125{{{#!rbox discussion
126= chat, discussion, talk
127}}}
128
129{{{#!rbox yes
130= ok, good, yes
131}}}
132
133{{{#!rbox no
134= bad, no, nok
135}}}
136
137
138{{{#!box configure style="margin-top:0"
139= configure, configuration, tool
140White boxes are part of the normal content.
141
142This box is created by the wiki markup
143{{{
144{{{#!box configure
145...
146}}}
147}}}
148or
149{{{
150{{{#!box type=configure
151...
152}}}
153}}}
154Alternatively, `configuration` or `tool` may be used too, as well as a unique
155abbreviation like `config`.
156}}}
157
158{{{#!box details
159= details, look, magnifier
160}}}
161
162{{{#!box stop
163= critical, stop
164Red boxes contain some really important information! Pay close attention to
165these to avoid running into problems.
166}}}
167
168{{{#!box warning
169= bug, error, important, warning
170}}}
171
172{{{#!box information
173= information, note
174Yellow boxes contain essential, but not critical information.
175}}}
176
177{{{#!box question
178= help, question
179}}}
180
181{{{#!box tips
182= tips
183}}}
184
185{{{#!box comment
186= comment
187Blue boxes contain elaborative information; they are used to elaborate on-going
188work and should not, ideally, be left behind when work is done.
189}}}
190
191{{{#!box discussion
192= chat, discussion, talk
193}}}
194
195{{{#!box yes
196= ok, good, yes
197}}}
198
199{{{#!box no
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
324A newsbox accepts the same parameters as an ordinary box, but are normally not
325used.
326
327
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
346An imagebox accepts the same parameters as an ordinary box, but are normally
347not used.
348
349
350== Macro syntax examples
351The macro syntax may be preferable for shorter content:
352
353[[rbox(A short comment)]]
354{{{
355[[rbox(A short comment)]]
356}}}
357
358The type can be set as a parameter:
359[[rbox(A short comment, type=comment)]]
360{{{
361[[rbox(A short comment, type=comment)]]
362}}}
363
364Alignment too:
365{{{
366[[box(Learn how to use boxes, align=center)]]
367}}}
368[[box(Learn how to use boxes, align=center)]]
369
370Finally, width as well:
371[[rbox(Auto-sized rbox, width=auto)]]
372{{{
373[[rbox(Auto-sized rbox, width=auto)]]
374}}}
375
376
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.