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|⚠️}}{{...") |
|||
| Line 1: | Line 1: | ||
| − | <includeonly>{{#switch: {{{type|note}}} | + | <includeonly>{| style="margin: 1.5em 0; padding: 0; border-left: 4px solid {{#switch: {{{type|note}}} |
| − | | note = | + | | note = #448aff |
| − | | warning = | + | | warning = #ff9100 |
| − | | tip = | + | | tip = #00bfa5 |
| − | | important = | + | | important = #ff1744 |
| − | | info = | + | | info = #2196f3 |
| − | | question = | + | | question = #9c27b0 |
| − | | caution = | + | | caution = #ff5722 |
| − | + | | #default = #448aff | |
| − | + | }}; background-color: #f8f9fa; width: 100%;" | |
| − | ! style="padding: 8px 12px; background-color: {{# | + | ! style="padding: 8px 12px; background-color: {{#switch: {{{type|note}}} |
| + | | note = #448aff15 | ||
| + | | warning = #ff910015 | ||
| + | | tip = #00bfa515 | ||
| + | | important = #ff174415 | ||
| + | | info = #2196f315 | ||
| + | | question = #9c27b015 | ||
| + | | caution = #ff572215 | ||
| + | | #default = #448aff15 | ||
| + | }}; font-weight: bold;" | {{#switch: {{{type|note}}} | ||
| + | | note = 📝 | ||
| + | | warning = ⚠️ | ||
| + | | tip = 💡 | ||
| + | | important = ❗ | ||
| + | | info = ℹ️ | ||
| + | | question = ❓ | ||
| + | | caution = 🚧 | ||
| + | | #default = 📝 | ||
| + | }} {{{title|{{#switch: {{{type|note}}} | ||
| + | | note = Note | ||
| + | | warning = Warning | ||
| + | | tip = Tip | ||
| + | | important = Important | ||
| + | | info = Info | ||
| + | | question = Question | ||
| + | | caution = Caution | ||
| + | | #default = Note | ||
| + | }}}}} | ||
|- | |- | ||
| style="padding: 12px;" | {{{1}}} | | style="padding: 12px;" | {{{1}}} | ||
| Line 37: | Line 64: | ||
=== Examples === | === Examples === | ||
| − | <nowiki> | + | <pre> |
| − | {{Admonition|This is a default note.}} | + | <nowiki>{{Admonition|This is a default note.}}</nowiki> |
| − | + | <nowiki>{{Admonition|type=warning|This is a warning message.}}</nowiki> | |
| − | {{Admonition|type=warning|This is a warning message.}} | + | <nowiki>{{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}}</nowiki> |
| − | + | <nowiki>{{Admonition|type=important|This is important information.}}</nowiki> | |
| − | {{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}} | + | <nowiki>{{Admonition|type=info|This is additional information.}}</nowiki> |
| − | + | <nowiki>{{Admonition|type=question|Have you considered this?}}</nowiki> | |
| − | {{Admonition|type=important|This is important information.}} | + | <nowiki>{{Admonition|type=caution|Proceed with caution.}}</nowiki> |
| − | + | </pre> | |
| − | {{Admonition|type=info|This is additional information.}} | ||
| − | |||
| − | {{Admonition|type=question|Have you considered this?}} | ||
| − | |||
| − | {{Admonition|type=caution|Proceed with caution.}} | ||
| − | </ | ||
=== Live Examples === | === Live Examples === | ||
Revision as of 01:44, 6 February 2025
Usage
This template creates admonition boxes (highlighted message boxes) with different styles based on type.
Syntax
{{Admonition|type=TYPE|text}}
or
{{Admonition|type=TYPE|title=CUSTOM TITLE|text}}
Available Types
- note (default) - For general information
- warning - For warning messages
- tip - For helpful tips
- important - For crucial information
- info - For additional information
- question - For questions or FAQs
- caution - For careful consideration
Examples
{{Admonition|This is a default note.}}
{{Admonition|type=warning|This is a warning message.}}
{{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}}
{{Admonition|type=important|This is important information.}}
{{Admonition|type=info|This is additional information.}}
{{Admonition|type=question|Have you considered this?}}
{{Admonition|type=caution|Proceed with caution.}}
Live Examples
- 448aff; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
|---|
| This is a default note. |
- ff9100; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
|---|
| This is a warning message. |
- 00bfa5; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
|---|
| This is a custom-titled tip. |