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 | {{warning}} | ||
10 | At the moment, rendered content cannot include newlines. | ||
11 | {{/warning}} | ||
12 | |||
13 | = Macro = | ||
14 | |||
15 | Simple text lozenge: | ||
16 | |||
17 | {{code}} | ||
18 | ## Macro title: loz | ||
19 | ## Macro has a body: No | ||
20 | ## @param text:title=Text|string=string | ||
21 | ## @param color:title=Color|type=string|required=true|default=#0000ff | ||
22 | ## @param textcolor:title=Text Color|type=string|required=true|default=#ffffff | ||
23 | <span style="background-color:$paramcolor; color:$paramtextcolor; border-radius:3px; padding:0px 3px 2px 3px">$paramtext</span> | ||
24 | {{/code}} | ||
25 | |||
26 | Make sure to select "No macro body" in the "Macro Body Processing" section. | ||
27 | |||
28 | Lozenge with rendered body: | ||
29 | |||
30 | {{code}} | ||
31 | ## Macro title: loz-body | ||
32 | ## Macro has a body: Yes | ||
33 | ## Body processing: Rendered | ||
34 | ## @param color:title=Color|type=string|required=true|default=#0000ff | ||
35 | ## @param textcolor:title=Text Color|type=string|required=true|default=#ffffff | ||
36 | <div style="display: inline-block; background-color:$paramcolor; color:$paramtextcolor; border-radius:3px; padding:0px 3px 2px 3px">$body</div> | ||
37 | {{/code}} | ||
38 | |||
39 | Make sure to select "Rendered" in the "Macro Body Processing" section. | ||
40 | |||
41 | = Using It = | ||
42 | |||
43 | Here are some simple lozenges: | ||
44 | |||
45 | * | ||
46 | * | ||
47 | * | ||
48 | * | ||
49 | |||
50 | {{loz color="red" textcolor="white" text="Danger"/}} | ||
51 | |||
52 | Some lozenges with inline, rendered body: | ||
53 | |||
54 | {{loz-body atlassian-macro-output-type="INLINE"}} | ||
55 | This **is** rendered //text//. | ||
56 | {{/loz-body}} | ||
57 | |||
58 | \\ | ||
59 | |||
60 | We can put | ||
61 | |||
62 | {{loz-body atlassian-macro-output-type="INLINE"}} | ||
63 | [[image:url:https://expl.info/images/logo/default-space-logo.svg]]icons | ||
64 | {{/loz-body}} | ||
65 | |||
66 | too! | ||
67 | |||
68 | \\ |