User:NicoV/TemplateDataEditor
Since there's now a Template Data Editor integrated into MediaWiki itself, this tool is not maintained anymore. |
TemplateDataEditor (TDE) is a script for visually editing TemplateData. It has been written by Ltrlg, originally for frwiki but now available for every wiki.
Installation
[edit]- Edit your common Custom JavaScript page or your skin Custom JavaScript page.
- Add a line with the following text
mw.loader.load('//fr.wikipedia.org/w/index.php?title=Utilisateur:Ltrlg/scripts/TemplateDataEditor.js&action=raw&ctype=text/javascript');
- Save the page
- Bypass your browser cache, so that the TDE script is correctly taken into account
Use
[edit]Starting
[edit]When you edit a template (or rather its documentation page) :
- Once you have started editing the template, you should see a link or in the edit toolbar.
- Check if the template page already contains a
<templatedata />
tag - If not, add an empty
<templatedata />
element in the wikitext (no need to save this modification) - Click on the "TDE" link
If there's no TemplateData
[edit]TemplateDataEditor suggests to prefill <templatedata />
by analysing the template code. To perform this, it uses Salix alba's TDSkell script.
Choose in the drop down list the template you are documenting and click on the "Execute" button.
Data modification
[edit]The modification window contains three sections: Description, Parameters and Sets.
Description section
[edit]The Description section allows you to describe the template in a translatable text area.
Parameters section
[edit]The Parameters section allows you to describe template parameters. It's composed of a list of parameters, each parameter being displayed completely or in short format
When a parameter is displayed in short format, it's possible:
- to set the real name of the parameter, which is the name used when using the template in wikitext ;
- to tell if the parameter is mandatory ;
- to inherit the documentation of an other parameter (all blank fields are filled with values coming from the other parameter) ;
- to display the parameter completely by clicking on the button ;
- to delete the parameter by clicking on the button.
When a parameter is displayed completely, it's possible:
- to display it in short format by clicking on the button ;
- to set a name for display (which is translatable) ;
- to tell the type of parameter and its default value ;
- to tell if the parameter is obsolete (by filling the filed with the procedure to replace the parameter) ;
- to give other names for the parameter ;
- to describe the parameter (descriptions are translatable).
At the bottom of the list, a button lets you create new parameters.
Sets section
[edit]The Sets section allows you to define sets of parameters that should be used in conjunction. It's composed of a list of sets.
Each line allows you:
- to give a name (translatable) to the set ;
- to tell which parameters are part of the set ;
- to delete the set by clicking on the button.
At the bottom of the list, a button lets you create new sets.
Translatable area
[edit]Some elements can be translated in several languages.
When starting TemplateDataEditor, only contents in the wiki language and your language are displayed. You can display other languages by clicking on button (or ) or hide them by clicking on button (or ).
When other languages are displayed, a button lets you add new languages. Except for the wiki language, you can delete a language by clicking on button.
Use in other wikis
[edit]- TDE is currently available in English, French, Greek, Korean, Japanese and Italian. If you want to contribute to translations, you can suggest translations at talk page on frwiki, the messages to be translated are at the beginning of script (
messages
variable). - TDE can be used directly from any wiki.
Known limitations and problems
[edit]Currently, TDE has the following limitations:
- Suggestion for aliases and default value from TDSkell script has not been integrated yet.
- Renaming a parameter moves it to the end of the list.
- Parameters with name containing
{
or}
can't be documented.