Wiki source code of Lozenges for Confluence
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | {{toc-local/}} | ||
4 | |||
5 | = Introduction = | ||
6 | |||
7 | A lozenge is nothing but content wrapped in a box with background color. Below are macros for two kinds of content: text only, rendered content. | ||
8 | |||
9 | = Macro = | ||
10 | |||
11 | Simple text lozenge: | ||
12 | |||
13 | {{code}} | ||
14 | ## Macro title: loz | ||
15 | ## Macro has a body: No | ||
16 | ## @param text:title=Text|string=string | ||
17 | ## @param color:title=Color|type=string|required=true|default=#0000ff | ||
18 | ## @param textcolor:title=Text Color|type=string|required=true|default=#ffffff | ||
19 | <span style="background-color:$paramcolor; color:$paramtextcolor; border-radius:3px; padding:0px 3px 2px 3px">$paramtext</span> | ||
20 | {{/code}} | ||
21 | |||
22 | Make sure to select "No macro body" in the "Macro Body Processing" section. | ||
23 | |||
24 | Lozenge with rendered body: | ||
25 | |||
26 | {{code}} | ||
27 | ## Macro title: loz-body | ||
28 | ## Macro has a body: Yes | ||
29 | ## Body processing: Rendered | ||
30 | ## @param color:title=Color|type=string|required=true|default=#0000ff | ||
31 | ## @param textcolor:title=Text Color|type=string|required=true|default=#ffffff | ||
32 | <div style="display: inline-block; background-color:$paramcolor; color:$paramtextcolor; border-radius:3px; padding:0px 3px 2px 3px">$body</div> | ||
33 | {{/code}} | ||
34 | |||
35 | Make sure to select "Rendered" in the "Macro Body Processing" section. | ||
36 | |||
37 | = Using It = | ||
38 | |||
39 | Here are some simple lozenges: | ||
40 | |||
41 | * | ||
42 | * | ||
43 | * | ||
44 | * | ||
45 | |||
46 | {{loz color="red" textcolor="white" text="Danger"/}} | ||
47 | |||
48 | Some lozenges with inline, rendered body: | ||
49 | |||
50 | * | ||
51 | * ((( | ||
52 | Here is | ||
53 | |||
54 | {{loz-body atlassian-macro-output-type="INLINE"}} | ||
55 | Multi | ||
56 | |||
57 | Line | ||
58 | |||
59 | Body | ||
60 | {{/loz-body}} | ||
61 | |||
62 | at work | ||
63 | ))) | ||
64 | |||
65 | {{loz-body atlassian-macro-output-type="INLINE"}} | ||
66 | This **is** rendered //text//. | ||
67 | {{/loz-body}} |