Difference between revisions of "Template:Admonition"
From ThresholdRPG Wiki
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
β | <div style=" | + | <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|#default=#448aff33}}; padding: 8px 12px; font-weight: bold;">{{#switch: {{{type|note}}}|note=π|warning=β οΈ|tip=π‘|important=β|#default=π}} {{{title|{{#switch: {{{type|note}}}|note=Note|warning=Warning|tip=Tip|important=Important|#default=Note}}}}} | + | <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> | ||
β | <div style="padding: 12px;">{{{1}}}</div> | + | <div style="padding: 12px; color: #ffffff;">{{{1}}}</div> |
</div> | </div> | ||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
== Usage == | == Usage == | ||
β | + | Create admonition boxes with different styles. | |
β | === | + | === Basic Usage === |
β | < | + | <nowiki> |
β | {{Admonition| | + | {{Admonition|Your message here}} |
β | + | </nowiki> | |
β | |||
β | |||
β | |||
β | </ | ||
β | === Available | + | === With Type === |
+ | <nowiki> | ||
+ | {{Admonition|type=warning|Your warning message}} | ||
+ | </nowiki> | ||
+ | |||
+ | === With Custom Title === | ||
+ | <nowiki> | ||
+ | {{Admonition|type=tip|title=Pro Tip!|Your tip message}} | ||
+ | </nowiki> | ||
+ | |||
+ | === 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 | * note (default) - For general information | ||
β | * warning - For | + | * warning - For cautionary notes |
* tip - For helpful tips | * tip - For helpful tips | ||
* important - For crucial information | * 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 === | === Live Examples === | ||
β | {{Admonition|This is a default note.}} | + | {{Admonition|This is a default note at full width.}} |
β | {{Admonition|type=warning|This is a warning message.}} | + | {{Admonition|width=50%|This is a note at 50% width.}} |
+ | |||
+ | {{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|type=tip|title=Pro Tip!|This is a custom-titled tip.}} | ||
+ | |||
+ | {{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.