Module:Term/doc: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
moved to Module:Term, fixing links
Aliser (talk | contribs)
updated
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{uses json data<!--
{{uses json data<!--
-->|Module:Term/terms.json<!--
-->|Module:Term/terms.json<!--
-->|Module:Term/term links.json<!--
-->}}
-->}}
}}
}}
Line 8: Line 7:
Implements {{t|Term}}.
Implements {{t|Term}}.


== terms.json ==
== Tests ==
This file contains definitions for terms.
[[Module:Term/testcases/keys]] - test whether keys in the JSON file are properly spelled (lowercase).


{{Callout|Warning|Use only lowercase for keys, otherwise the term finder won't work. On other hand, value can be any wikitext.}}
{{#invoke:Term/testcases/keys|run}}
 
== Adding new terms ==
Go to the JSON file linked at the top of this page.
 
That file contains definitions for terms.
 
Term is defined with a '''lowercase key''' and an object value.
 
The object value has following format:
<syntaxhighlight lang="json">
{
"display": "[optional] what to display, for example: LRP",
    "definition": "term definition",
    "link": "[optional] a page to link the term to",
}
</syntaxhighlight>
 
Note that at least a definition or a link should be provided for a term.

Latest revision as of 06:22, 25 May 2025

Module documentation
View or edit this documentation (about module documentation)
Uses JSON data
This module uses JSON data pages:

Implements {{Term}}.

Tests

Module:Term/testcases/keys - test whether keys in the JSON file are properly spelled (lowercase).

✅ All tests passed.

Name Expected Actual
test_keys_casing


Adding new terms

Go to the JSON file linked at the top of this page.

That file contains definitions for terms.

Term is defined with a lowercase key and an object value.

The object value has following format:

{
	"display": "[optional] what to display, for example: LRP",
    "definition": "term definition",
    "link": "[optional] a page to link the term to",
}

Note that at least a definition or a link should be provided for a term.