Template:SyntaxHighlight header: Difference between revisions

From Mainlining Wiki
Jump to navigation Jump to search
Knuxify (talk | contribs)
Created page with "<noinclude> <templatedata> { "params": { "text": { "aliases": [ "1" ], "label": "Text", "description": "Text to place in the header.", "type": "unbalanced-wikitext", "required": true } }, "description": "Header that can be placed before a <syntaxhighlight> tag to e.g. show a filename or block title.", "format": "inline" } </templatedata> == Example == <pre><nowiki> {{SyntaxHighlight header|foo.dts}} <syntaxhighlight lang="dts" line> /dts-v..."
 
Knuxify (talk | contribs)
move template source above template data
 
Line 1: Line 1:
<noinclude>
<includeonly><div class="mw-highlight mainline-syntaxhighlight-header" style="background: var(--background-color-neutral,#eaecf0); color: var(--color-base,#202122); margin-bottom: -1em; padding: 0.35em 1.05em; border: 1px solid var(--border-color-muted,#dadde3); border-bottom: none; font-family: monospace; font-weight: bold;">{{{text|{{{1|}}}}}}</div></includeonly><!--
 
--><noinclude>
<templatedata>
<templatedata>
{
{
Line 53: Line 55:
};
};
</syntaxhighlight>
</syntaxhighlight>
</noinclude><includeonly><!--
</noinclude>
--><div class="mw-highlight mainline-syntaxhighlight-header" style="background: var(--background-color-neutral,#eaecf0); color: var(--color-base,#202122); margin-bottom: -1em; padding: 0.35em 1.05em; border: 1px solid var(--border-color-muted,#dadde3); border-bottom: none; font-family: monospace; font-weight: bold;">{{{text|{{{1|}}}}}}</div></includeonly>

Latest revision as of 18:01, 20 February 2025

Header that can be placed before a <syntaxhighlight> tag to e.g. show a filename or block title.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Texttext 1

Text to place in the header.

Unbalanced wikitextrequired

Example

{{SyntaxHighlight header|foo.dts}}
<syntaxhighlight lang="dts" line>
/dts-v1/;

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	
	my_node: node1@1000 {
		compatible = "vendor,foo";
		reg = <0x1000 0x54>;
		vendor,bar-factor = <0x2a>;
	};
};
</syntaxhighlight>
foo.dts
/dts-v1/;

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	
	my_node: node1@1000 {
		compatible = "vendor,foo";
		reg = <0x1000 0x54>;
		vendor,bar-factor = <0x2a>;
	};
};