Template:HexString: Difference between revisions

From The Talos Principle Wiki
Currently uses tooltip (<abbr>). Feel free to change.
 
m TemplateData
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<abbr title="{{{2}}}">{{{1}}}</abbr>
{{#ifeq:{{{2|}}}|{{{2}}}|<span style="overflow-wrap: anywhere; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: black;" title="{{{2}}}">{{{1}}}</span>|<span style="overflow-wrap: anywhere; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: red;">{{{1}}}</span>[[Category:Pages with untranslated hex strings]]}}<noinclude>
<noinclude>
This is used to show translations of hex strings.
== Usage ==
== Usage ==
This is used to show hex strings, with or without translations.
* If a translation is provided, it is shown in a tooltip (this formatting may change in the future).
* If a translation is not provided, the page is automatically added to [[:Category:Pages with untranslated hex strings]].
<pre>{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.</pre>
That shows up as:
{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.
=== Multiple lines: ===
You can break both the text and the tooltip into multiple lines. The text follows the usual MediaWiki conventions, but for the tooltip you need to explicitly break the text using the newline/line feed HTML character entity:
<pre>{{HexString
<pre>{{HexString
|49206861766520646f6e65206974
|
|I have done it
48656c6c6f2c0a
776f726c64
|Hello,&amp;NewLine;world
}}</pre>
}}</pre>


That should show up as
Produces:
<div style="width: 300px">
{{HexString
{{HexString
|49206861766520646f6e65206974
|
|I have done it
48656c6c6f2c0a
776f726c64
|Hello,&NewLine;world
}}
}}
</div>
<templatedata>
</noinclude>
{
"params": {
"1": {
"label": "Hex",
"description": "The hex string.",
"example": "48656c6c6f",
"type": "string",
"required": true
},
"2": {
"label": "Translation",
"description": "The English text corresponding the hex. Use &NewLine; for a line break.",
"example": "hello",
"type": "string",
"suggested": true
}
},
"description": "This is used to show hex strings, with or without translations."
}
</templatedata></noinclude>

Latest revision as of 14:19, 22 November 2023

{{{1}}}

Usage

This is used to show hex strings, with or without translations.

{{HexString|48656c6c6f|Hello}} is translated, {{HexString|00}} is not translated.

That shows up as:

48656c6c6f is translated, 00 is not translated.

Multiple lines:

You can break both the text and the tooltip into multiple lines. The text follows the usual MediaWiki conventions, but for the tooltip you need to explicitly break the text using the newline/line feed HTML character entity:

{{HexString
|
48656c6c6f2c0a
776f726c64
|Hello,&NewLine;world
}}

Produces: 48656c6c6f2c0a 776f726c64

This is used to show hex strings, with or without translations.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Hex1

The hex string.

Example
48656c6c6f
Stringrequired
Translation2

The English text corresponding the hex. Use &NewLine; for a line break.

Example
hello
Stringsuggested