Module:Role/doc: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
Created page with "{{module docs}} Implements {{t|Role}}."
 
Aliser (talk | contribs)
docs
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{module docs}}
{{module docs|bb=
{{uses json data|Module:Role/roles.json}}
}}


Implements {{t|Role}}.
Implements {{t|Role}}.
== How to add/edit/remove a role ==
Go to the roles JSON file (linked at the top).
Each key is a role name that can be used in the template. '''These must all be lowercase.'''
Each value is an object with properties:
<syntaxhighlight lang="json">
{
"display": "[required] display name aka the label that would be displayed, for example: Atmospheric Technician",
"icon": "[optional] icon file name, for example: File:JobIconStationEngineer.png",
"link": "[optional] page name to link to, for example: Station Engineer"
}
</syntaxhighlight>
Value can also be a string. This is used to make abbreviations. Note that abbreviations are only used to lookup roles, they cannot be displayed.
To make an abbreviation, put the key of another role as a value. For example, to add a an {{c|atmosian}} abbreviation for an {{c|Atmospheric Technician}}:
<syntaxhighlight lang="json">
{
"atmosian": "atmospheric technician",
"atmospheric technician": {
"display": "Atmospheric Technician",
"icon": "File:JobIconAtmosphericTechnician.png",
"link": "Atmospheric Technician"
}
}
</syntaxhighlight>

Latest revision as of 03:43, 15 March 2025

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

Implements {{Role}}.

How to add/edit/remove a role

Go to the roles JSON file (linked at the top).

Each key is a role name that can be used in the template. These must all be lowercase.

Each value is an object with properties:

{
	"display": "[required] display name aka the label that would be displayed, for example: Atmospheric Technician",
	"icon": "[optional] icon file name, for example: File:JobIconStationEngineer.png",
	"link": "[optional] page name to link to, for example: Station Engineer"
}

Value can also be a string. This is used to make abbreviations. Note that abbreviations are only used to lookup roles, they cannot be displayed.

To make an abbreviation, put the key of another role as a value. For example, to add a an atmosian abbreviation for an Atmospheric Technician:

{
	"atmosian": "atmospheric technician",
	"atmospheric technician": {
		"display": "Atmospheric Technician",
		"icon": "File:JobIconAtmosphericTechnician.png",
		"link": "Atmospheric Technician"
	}
}