Template:label/documentation: Difference between revisions
No edit summary |
TheNightAvl (talk | contribs) m (→Wordlinks) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{documentation subpage}} | |||
{{uses lua|Module:labels}} | {{uses lua|Module:labels}} | ||
{{shortcut|Template:lab|Template:lb}} | |||
This template can be used to add labels to a language's definition of a term. It will automatically handle the addition of categories relating to the labels. | This template can be used to add labels to a language's definition of a term. It will automatically handle the addition of categories relating to the labels. | ||
Line 8: | Line 10: | ||
==Usage== | ==Usage== | ||
{{tempn|label|kil|intrans | {{tempn|label|kil|intrans}} | ||
Generates: | Generates: | ||
: {{label|kil|intrans | : {{label|kil|intrans|nocat=1}} | ||
and automatically adds the category [[:Kilitic intransitive verbs]]. | and automatically adds the category [[:Category:Kilitic intransitive verbs]]. | ||
===Parameters=== | ===Parameters=== | ||
Line 20: | Line 22: | ||
; {{para|2}}, {{para|3}}, etc. | ; {{para|2}}, {{para|3}}, etc. | ||
: You can put as many label identifiers as you'd like and they | : You can put as many label identifiers as you'd like and the template will handle ensuring they appear nicely together. | ||
; {{para|nocat}} | ; {{para|nocat}} | ||
: When specified as true (e.g. {{para|nocat|1}}) then no categories will be automatically added to the page. | : When specified as true (e.g. {{para|nocat|1}}) then no categories will be automatically added to the page. | ||
=== Funky formatting === | |||
==== Wordlinks ==== | |||
Using <code>"quotation marks"</code> or <code>*asterisks*</code> in a parameter will create a wordlink. | |||
{{tempn|label|kil|intrans|with preposition "le"}} | |||
{{tempn|label|kil|intrans|with preposition *le*}} | |||
: {{label|kil|intrans|with preposition *le*|nocat=1}} | |||
==== Comma overriding ==== | |||
Using <code>_</code> at the start of a parameter will override comma delimiting. Note that some words, such as <code>mostly</code>, <code>and</code>, <code>or</code> and <code>with</code>, automatically override commit delimiting. | |||
{{tempn|label|rad|most commonly|intrans}} | |||
: {{label|rad|most commonly|intrans|nocat=1}} | |||
{{tempn|label|rad|most commonly|_intrans}} | |||
: {{label|rad|most commonly|_intrans|nocat=1}} | |||
{{tempn|label|rad|intrans|or|trans}} | |||
: {{label|rad|intrans|or|trans|nocat=1}} | |||
==== Slash functionality ==== | |||
Using <code>/</code> will automatically override commas and spacing: | |||
{{tempn|label|rad|intrans|/|trans}} | |||
: {{label|rad|intrans|/|trans|nocat=1}} | |||
==== Parameter splitting ==== | |||
Using commas within a parameter can also be used to divide variables. Note that slash functionality and wordlinks can be used multiple times within a parameter, and all automatic comma overriding will still take place. | |||
{{tempn|label|rad|intrans, trans}} | |||
: {{label|rad|intrans, trans|nocat=1}} | |||
{{tempn|label|rad|intrans or trans}} | |||
: {{label|rad|intrans or trans|nocat=1}} | |||
{{tempn|label|rad|intrans/trans}} | |||
: {{label|rad|intrans/trans|nocat=1}} | |||
{{tempn|label|kil|intrans, with preposition "le"}} | |||
: {{label|kil|intrans, with preposition "le"|nocat=1}} | |||
{{tempn|label|rad|refl, with "dzist"/"dzisk"}} | |||
: {{label|rad|refl, with "dzist"/"dzisk"|nocat=1}} |
Latest revision as of 17:12, 23 February 2024
Uses Lua: |
Shortcut
{{lb}} |
This template can be used to add labels to a language's definition of a term. It will automatically handle the addition of categories relating to the labels.
You can add labels that are pre-defined and many include extra formatting (e.g. linking to the glossary) or auto-categorisation, or you can add your own free-form labels.
The full list of available labels is located in code at Module:labels/data.
Usage
{{label|kil|intrans}}
Generates:
and automatically adds the category Category:Kilitic intransitive verbs.
Parameters
|1=
- The language code of the language whose definition you are applying this label to.
|2=
,|3=
, etc.- You can put as many label identifiers as you'd like and the template will handle ensuring they appear nicely together.
|nocat=
- When specified as true (e.g.
|nocat=1
) then no categories will be automatically added to the page.
Funky formatting
Wordlinks
Using "quotation marks"
or *asterisks*
in a parameter will create a wordlink.
{{label|kil|intrans|with preposition "le"}} {{label|kil|intrans|with preposition *le*}}
- (intransitive with preposition le)
Comma overriding
Using _
at the start of a parameter will override comma delimiting. Note that some words, such as mostly
, and
, or
and with
, automatically override commit delimiting.
{{label|rad|most commonly|intrans}}
- (most commonly, intransitive)
{{label|rad|most commonly|_intrans}}
- (most commonly intransitive)
{{label|rad|intrans|or|trans}}
- (intransitive or transitive)
Slash functionality
Using /
will automatically override commas and spacing:
{{label|rad|intrans|/|trans}}
Parameter splitting
Using commas within a parameter can also be used to divide variables. Note that slash functionality and wordlinks can be used multiple times within a parameter, and all automatic comma overriding will still take place.
{{label|rad|intrans, trans}}
{{label|rad|intrans or trans}}
- (intransitive or transitive)
{{label|rad|intrans/trans}}
{{label|kil|intrans, with preposition "le"}}
- (intransitive with preposition le)
{{label|rad|refl, with "dzist"/"dzisk"}}