Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:CollapsibleCode: Difference between revisions

Template page
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
<templatestyles src="Template:CollapsibleCode/styles.css"/>
<templatestyles src="Template:CollapsibleCode/styles.css"/>
<div id="collapsible-container" class="mw-collapsible {{#ifeq:{{{collapsed|true}}}|true|mw-collapsed}}" style="width: {{{width|100%}}};">
<div id="collapsible-container" class="mw-collapsible {{#ifeq:{{{collapsed|true}}}|true|mw-collapsed}}" style="width: {{{width|100%}}};">
<div id="collapsible-container-header" style="text-align: center;">{{#far:chevron-down}}{{#far:chevron-up}} {{{heading|Code}}}</div>
<div id="collapsible-container-header"><i class="fa-solid fa-chevron-down"></i><i class="fa-solid fa-chevron-up"></i> {{{heading|Code}}}</div>
<div class="mw-collapsible-content" style="font-family: monospace;">
<div class="mw-collapsible-content" style="font-family: monospace;">
{{{code|{{{1|}}}}}}
{{{code|{{{1|}}}}}}
Line 18: Line 18:
{
{
"params": {
"params": {
"collapsed": {},
"collapsed": {
"width": {},
"description": "Whether or not it is collapsed by default",
"heading": {},
"type": "boolean",
"code": {}
"default": "true"
},
"width": {
"description": "The width of the entire code box",
"type": "string",
"default": "100%"
},
"heading": {
"description": "The heading/headline for the code box",
"type": "string",
"default": "Code"
},
"code": {
"description": "The actual content of the box. This can also be supplied as  a unnamed parameter",
"type": "content",
"required": true
}
},
},
"format": "inline"
"format": "inline"

Latest revision as of 00:56, 25 December 2024


A simple template to add a collapsible (and by default collapsed) bit of code to a wiki page


Something

This is some test code text.
It can have multiple lines
and they should show up correctly.


No description.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
collapsedcollapsed

Whether or not it is collapsed by default

Default
true
Booleanoptional
widthwidth

The width of the entire code box

Default
100%
Stringoptional
headingheading

The heading/headline for the code box

Default
Code
Stringoptional
codecode

The actual content of the box. This can also be supplied as a unnamed parameter

Contentrequired
Cookies help us deliver our services. By using our services, you agree to our use of cookies.