v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Template:Key/doc"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(fix)
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
E{{key|x}}ample.
 
E{{key|x}}ample.
 +
 +
Single uppercase letters provide a tooltip when hovered over: {{k|A}} is {{k-|Shift|a}}
  
 
===Usage===
 
===Usage===
Line 12: Line 14:
  
 
<pre><nowiki>E{{k|x}}ample.</nowiki></pre>
 
<pre><nowiki>E{{k|x}}ample.</nowiki></pre>
 +
 +
Multiple keys can be passed as separate parameters to this template, with the ``sep`` parameter determining the separator (the default is an empty string). {{tl|k-}} can be used as a shortcut for {{tl|k|sep{{=}}-}}:
 +
 +
{|class="wikitable"
 +
|-
 +
|``<nowiki>{{k|a|b}}</nowiki>`` || {{k|a|b}}
 +
|-
 +
|``<nowiki>{{k|a|b|sep=,}}</nowiki>`` || {{k|a|b|sep=,}}
 +
|-
 +
|``<nowiki>{{k|sep=+|a|b|c}}</nowiki>`` || {{k|sep=+|a|b|c}}
 +
|-
 +
|``<nowiki>{{k|a|b|c|sep=-}}</nowiki>`` || {{k|a|b|c|sep=-}}
 +
|-
 +
|``<nowiki>{{k-|a|b|c}}</nowiki>`` || {{k-|a|b|c}}
 +
|-
 +
|``<nowiki>{{k|a|b|c|sep=&amp;rarr;}}</nowiki>`` || {{k|a|b|c|sep=&rarr;}}
 +
|}
 +
 +
===Tests for special characters that sometimes break===
 +
* test {{k|*}} test
 +
* test {{k|{{=}}}} test
 +
* test {{k|;}} test
 +
* test {{k|:}} test
 +
* test {{k|'}} test
 +
* test {{k|''}} test
 +
* test {{k|<}} test
 +
* test {{k|>}} test
 +
  
 
<includeonly>[[Category:Inline formatting templates]]</includeonly>
 
<includeonly>[[Category:Inline formatting templates]]</includeonly>
 
<noinclude>[[Category:Template Documentation]]</noinclude>
 
<noinclude>[[Category:Template Documentation]]</noinclude>

Latest revision as of 23:22, 3 April 2021

Shortcut:
Template:K

Example of Appearance[edit]

Example.

Single uppercase letters provide a tooltip when hovered over: A is Shift-a

Usage[edit]

E{{key|x}}ample.

{{k}} redirects here, for quicker access to this command, and should be used as a shortcut.

E{{k|x}}ample.

Multiple keys can be passed as separate parameters to this template, with the sep parameter determining the separator (the default is an empty string). {{k-}} can be used as a shortcut for {{k|sep=-}}:

{{k|a|b}} ab
{{k|a|b|sep=,}} a,b
{{k|sep=+|a|b|c}} a+b+c
{{k|a|b|c|sep=-}} a-b-c
{{k-|a|b|c}} a-b-c
{{k|a|b|c|sep=&rarr;}} abc

Tests for special characters that sometimes break[edit]

  • test * test
  • test = test
  • test ; test
  • test : test
  • test ' test
  • test '' test
  • test < test
  • test > test