Prijeđi na sadržaj

Wikipedija:TemplateData

Izvor: Wikipedija

What is TemplateData?

[uredi kôd]

TemplateData is the standardized description of a template, used by VisualEditor, the 2017 wikitext editor and other tools to improve the template-editing experience for the user. Both VisualEditor and the 2017 wikitext editor include a wizard to edit templates, but for the wizard to be most useful, it needs to present specific information to the user about each template, such as a short description of the template's purpose and its parameters. This information is codified formally (by any wiki editor) using TemplateData.

Editing without TemplateData

[uredi kôd]

Without TemplateData, each parameter needs to be added manually when inserting a new template.

No information is provided about what the value of the parameter should be.

Editing with TemplateData

[uredi kôd]

With TemplateData, a list of supported parameters (and their description) is provided for the template.

TemplateData provides context for each parameter, and makes it much easier for users to modify templates.

Adding TemplateData

[uredi kôd]

Anyone can help by adding TemplateData to templates (particularly high-profile ones, such as infoboxes) so that they are easier to edit in VisualEditor. The following is a minimal example, placed on a template's documentation page:

<templatedata>{
  "description": "insert description here",
  "params": {
    "first parameter": {
      "label": "x",
      "description": "x",
      "type": "string",
      "default": "default value",
      "required": false
    }
  }
}</templatedata>

You can also add or edit TemplateData using a GUI, by pressing the following button which appears at the top of the edit page: Manage TemplateData

The TemplateData tutorial explains in detail how to add TemplateData information to a template.

Commonly used templates

[uredi kôd]

List maintenance

[uredi kôd]

Here is a list of the most commonly used templates. When you've added TemplateData to one, add a {{Done}} mark behind it; we'll update the list with new additions as we go. It's advisable to do a null edit on the main template page to force the system to update the database. You can also look at this list of popular templates with no TemplateData or this list of popular templates from May 2015.

  • For completed items, consult the bot-generated logging page Wikipedia:VisualEditor/TemplateData/List.
  • If you complete an item, add {{Done}} after the entry until the item appears on the logging page.
  • If you partly complete an item, add {{Partly done|<explain what still needs to be done>}} to the entry and do not remove it from this list until it is completed. Partly done items will appear on the logging page as if they were completed.
  • Templates not suitable for TemplateData or with technical problems: add {{Not done|<briefly explain why TemplateData couldn't be added>}} after the entry.

Data sources

[uredi kôd]
  • Raw data for the initial template usage statistics are stored on Phabricator in this list.
  • A formatted, partially cleaned up version of this data with usage count values is stored at Wikipedia:TemplateData/Template usage count.
  • Previous lists, based on data of 2013, have been archived at Wikipedia:TemplateData/Archive1, including lists of meta-templates and templates in other namespaces.
  • This list depends on Category:TemplateData documentation for filtering and may include a limited number of already "logged" Template Data additions. Those templates just need a in their TemplateData section and should be marked as "Done".

See also

[uredi kôd]