Template:Code/doc
This is a documentation subpage for Template:Code. It contains usage information, categories, and other content that is not part of the original template page. |
This template has a different purpose than the template of the same name on English Wikipedia. For syntax highlighting, see {{code2}}.
This templates codes a string according to Template:Nfchr into "page title" form, so that it can be passed on to a template as a single parameter, and can be decomposed with #titleparts
and Template:Digit.
The maximum string length is 119 (excess characters are ignored), resulting in a "page title" of 254 characters. These resulting characters are digits and slashes only, so the string is a valid page title in canonical form, so it is suitable for application of #titleparts
without being affected by automatic conversions.
It is an expensive string operation: for the long example below we have:
Preprocessor node count: 19659/1000000 Post-expand include size: 30013/2048000 bytes Template argument size: 293342/2048000 bytes Expensive parser function count: 0/500
Therefore it can be useful to substitute the result, or copy it manually from preview to insert it in a wikitext.
The inverse of this template is Template:Chr119.
Examples
edit"{{code|Wikipedia}}"
→ "87091109160504/0901///////////////" [1]
"{{code|Imagine a world in which every single person on the planet is given free access to the sum of all human knowledge.}}"
→ "73130107091405/32013223151812/04320914322308/09030832052205/18253219091407/12053216051819/15143215143220/08053216120114/05203209193207/09220514320618/05053201030305/19193220153220/08053219211332/15063201121232/08211301143211/14152312050407/0546" [2]
See also
edit