Template:Boxcode: Difference between revisions
Jump to navigation
Jump to search
m (Probably there are better ways to implement the "custom title" but i dont want to break/update the other pages using this template, i think in the way im doing it is not going to break them) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<div style="float:left; text-align:left; width:100%; background:#e5e5ff; border:3px ridge #8888ff;">[[image:Edit-copy_green.svg.png|link=|20x20px]] | <div style="float:left; text-align:left; width:100%; background:#e5e5ff; border:3px ridge #8888ff;">[[image:Edit-copy_green.svg.png|link=|20x20px]]<span style="font-family:Arial; font-weight:bold; font-style:italic;">{{{title|Code Sample}}}</span> | ||
<div style="margin:10px; margin-top:-10px; overflow:auto;" | <div style="margin:10px; margin-top:-10px; overflow:auto;">{{{content|}}}</div> | ||
</div> | </div> | ||
<div style="clear:both;"></div><noinclude> | <div style="clear:both;"></div><noinclude> | ||
==Usage== | ==Usage== | ||
<nowiki>{{Boxcode|content= | <nowiki>{{Boxcode|content=Code Sample}}</nowiki> | ||
<br>...or...<br> | |||
<nowiki>{{Boxcode|title=Custom Title|content=Code Sample}}</nowiki> | |||
<br>...or...<br> | |||
<strike><nowiki>{{Boxcode|content=Code Sample|title=Custom Title}}</nowiki></strike>. In this order works too, but is not convenient, better avoid it | |||
==Example== | ==Example== | ||
{{Boxcode|content= | {{Boxcode|title=Custom Title|content=<syntaxhighlight lang="xml"> | ||
<syntaxhighlight lang="xml"> | <code> | ||
code | |||
lines | lines | ||
here | <!--here--> | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages ...............................................................................................................................................................................................................................................................................................o/sup | ||
</syntaxhighlight> | </syntaxhighlight>}} | ||
[[Category:templates]]</noinclude> | [[Category:templates]]</noinclude> |
Revision as of 00:22, 24 August 2021
Code Sample
Usage
{{Boxcode|content=Code Sample}}
...or...
{{Boxcode|title=Custom Title|content=Code Sample}}
...or...
{{Boxcode|content=Code Sample|title=Custom Title}}. In this order works too, but is not convenient, better avoid it
Example
Custom Title
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages ...............................................................................................................................................................................................................................................................................................o/sup