Difference between revisions of "Template:Admonition"
From ThresholdRPG Wiki
(Created page with "<includeonly>{{#switch: {{{type|note}}} | note = {{#vardefine: icon|π}}{{#vardefine: color|#448aff}}{{#vardefine: title|Note}} | warning = {{#vardefine: icon|β οΈ}}{{...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
β | <includeonly>{{#switch: {{{type|note}}} | + | <includeonly> |
β | + | <div style="border-left: 4px solid {{#switch: {{{type|note}}}|note=#448aff|warning=#ff9100|tip=#00bfa5|important=#ff1744|stop=#ff0000|#default=#448aff}}; background: #444444; margin: 1em 0; border-radius: 3px; width: {{{width|100%}}};"> | |
β | + | <div style="background: {{#switch: {{{type|note}}}|note=#448aff33|warning=#ff910033|tip=#00bfa533|important=#ff174433|stop=#ff000033|#default=#448aff33}}; padding: 8px 12px; font-weight: bold; color: #ffffff;">{{#switch: {{{type|note}}}|note=π|warning=β οΈ|tip=π‘|important=β|stop=π|#default=π}} {{{title|{{#switch: {{{type|note}}}|note=Note|warning=Warning|tip=Tip|important=Important|stop=STOP|#default=Note}}}}} | |
β | + | </div> | |
β | + | <div style="padding: 12px; color: #ffffff;">{{{1}}}</div> | |
β | + | </div> | |
β | |||
β | |||
β | |||
β | |||
β | |||
β | |||
β | |||
β | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
== Usage == | == Usage == | ||
β | + | Create admonition boxes with different styles. | |
β | === | + | === Basic Usage === |
β | < | + | <nowiki> |
β | {{Admonition| | + | {{Admonition|Your message here}} |
β | + | </nowiki> | |
β | |||
β | |||
β | |||
β | </ | ||
β | === | + | === With Type === |
β | + | <nowiki> | |
β | + | {{Admonition|type=warning|Your warning message}} | |
β | + | </nowiki> | |
β | |||
β | |||
β | |||
β | |||
β | === | + | === With Custom Title === |
<nowiki> | <nowiki> | ||
β | {{Admonition| | + | {{Admonition|type=tip|title=Pro Tip!|Your tip message}} |
+ | </nowiki> | ||
β | {{Admonition|type=warning| | + | === With Custom Width === |
+ | <nowiki> | ||
+ | {{Admonition|width=50%|Your message here}} | ||
+ | {{Admonition|type=warning|width=75%|Your warning message}} | ||
+ | </nowiki> | ||
β | + | === Types Available === | |
+ | * note (default) - For general information | ||
+ | * warning - For cautionary notes | ||
+ | * tip - For helpful tips | ||
+ | * important - For crucial information | ||
+ | * stop - For breaking changes or critical warnings | ||
β | + | === Parameters === | |
+ | * type - The type of admonition (optional, defaults to "note") | ||
+ | * title - Custom title (optional, defaults based on type) | ||
+ | * width - Custom width (optional, defaults to "100%") | ||
+ | * message - The main content (required) | ||
β | {{Admonition | + | === Live Examples === |
+ | {{Admonition|This is a default note at full width.}} | ||
β | {{Admonition| | + | {{Admonition|width=50%|This is a note at 50% width.}} |
β | {{Admonition|type= | + | {{Admonition|type=warning|width=75%|This is a warning message at 75% width.}} |
β | |||
β | + | {{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}} | |
β | {{Admonition|This is a | ||
β | {{Admonition|type= | + | {{Admonition|type=stop|width=60%|This feature is being removed in the next version. Do not use it for new development.}} |
β | |||
β | |||
</noinclude> | </noinclude> |
Latest revision as of 19:24, 6 February 2025
Usage
Create admonition boxes with different styles.
Basic Usage
{{Admonition|Your message here}}
With Type
{{Admonition|type=warning|Your warning message}}
With Custom Title
{{Admonition|type=tip|title=Pro Tip!|Your tip message}}
With Custom Width
{{Admonition|width=50%|Your message here}} {{Admonition|type=warning|width=75%|Your warning message}}
Types Available
- note (default) - For general information
- warning - For cautionary notes
- tip - For helpful tips
- important - For crucial information
- stop - For breaking changes or critical warnings
Parameters
- type - The type of admonition (optional, defaults to "note")
- title - Custom title (optional, defaults based on type)
- width - Custom width (optional, defaults to "100%")
- message - The main content (required)
Live Examples
π Note
This is a default note at full width.
π Note
This is a note at 50% width.
β οΈ Warning
This is a warning message at 75% width.
π‘ Pro Tip!
This is a custom-titled tip.
π STOP
This feature is being removed in the next version. Do not use it for new development.