User:Salix alba/TDSkell

A javascript snippet to generate a skeleton TemplateData section for a template. It reads the template code to find all the parameters used by the template.

==Usage1 2 3 4 5 6 7 8 9 11 12 س-ب==

To install include in Special:MyPage/skin.js.

On templates and user pages a link  will appear in the toolbox on the left sidebar. Clicking the link will open an overlay with a skeleton for the templatedata for the template you are looking at. Copy and paste and click the close box.

It also tries to guess default values, aliases, and whether the parameter is required or not. These may not correct. They are listed after the main skeleton:

How it works
A simple regular expression is used to find all parameters used in a template. It looks for patterns like  or.

The pattern used is.

Require parameter are tested by looking for, if a parameter appears with a pipe option   it will not be considered required. Defaults and aliases are found by examining the text following the pipe.

ToDo

 * Check for aliases
 * Integrate with TemplateDataEditor fr:Utilisateur:Ltrlg/scripts/TemplateDataEditor.js

Links

 * User:Salix alba/TDSkell.js the javascript
 * User:Salix alba/TDSkell.css the css
 * fr:Utilisateur:Ltrlg/scripts/TemplateDataEditor.js the TemplateDataEditor on which the code is heavily based