Difference between revisions of "Template:Admonition"

From ThresholdRPG Wiki
 
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
βˆ’
<div style="border-radius: 4px; border-left: 4px solid {{#switch: {{{type|note}}}|note=#448aff|warning=#ff9100|tip=#00bfa5|important=#ff1744|#default=#448aff}}; background: #444444; margin: 1em 0; border-radius: 3px;">
+
<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 ==
βˆ’
This template creates admonition boxes (highlighted message boxes) with different styles based on type.
+
Create admonition boxes with different styles.
  
βˆ’
=== Syntax ===
+
=== Basic Usage ===
βˆ’
<pre>
+
<nowiki>
βˆ’
{{Admonition|type=TYPE|text}}
+
{{Admonition|Your message here}}
βˆ’
</pre>
+
</nowiki>
βˆ’
or
 
βˆ’
<pre>
 
βˆ’
{{Admonition|type=TYPE|title=CUSTOM TITLE|text}}
 
βˆ’
</pre>
 
  
βˆ’
=== Available Types ===
+
=== 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 messages
+
* warning - For cautionary notes
 
* tip - For helpful tips
 
* tip - For helpful tips
 
* important - For crucial information
 
* important - For crucial information
βˆ’
* info - For additional information
+
* stop - For breaking changes or critical warnings
βˆ’
* question - For questions or FAQs
 
βˆ’
* caution - For careful consideration
 
  
βˆ’
=== Examples ===
+
=== Parameters ===
βˆ’
<pre>
+
* type - The type of admonition (optional, defaults to "note")
βˆ’
<nowiki>{{Admonition|This is a default note.}}</nowiki>
+
* title - Custom title (optional, defaults based on type)
βˆ’
<nowiki>{{Admonition|type=warning|This is a warning message.}}</nowiki>
+
* width - Custom width (optional, defaults to "100%")
βˆ’
<nowiki>{{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}}</nowiki>
+
* message - The main content (required)
βˆ’
<nowiki>{{Admonition|type=important|This is important information.}}</nowiki>
 
βˆ’
<nowiki>{{Admonition|type=info|This is additional information.}}</nowiki>
 
βˆ’
<nowiki>{{Admonition|type=question|Have you considered this?}}</nowiki>
 
βˆ’
<nowiki>{{Admonition|type=caution|Proceed with caution.}}</nowiki>
 
βˆ’
</pre>
 
  
 
=== 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.