Template:Js doclink/doc

From Linux Web Expert

Revision as of 20:59, 19 December 2023 by imported>APaskulin (WMF) (Update docs to use an example that isn't OOUI)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


This template creates a link to the auto-generated Javascript API documentation at https://doc.wikimedia.org/

Usage

Link to a class or method, with optional custom link text.

{{js doclink|mw.user}}mw.user

{{js doclink|mw.user|text=a widget}}a widget

{{js doclink|mw.user|method=getId}}mw.user.getId()

{{js doclink|mw.user|method=getId|text=some method}}some method

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Js doclink/doc

<templatedata> { "params": { "1": { "type": "string", "required": true }, "class": { "label": "JS class name", "example": "mw.user", "type": "string" }, "method": { "label": "JS method name", "example": "getId", "type": "string" }, "text": { "label": "Link text", "type": "string" } }, "description": "Link to API documentation at docs.wikimedia.org", "paramOrder": [ "1", "class", "method", "text" ], "format": "inline" } </templatedata>

See also