Module talk:Check for unknown parameters
Latest comment: 11 years ago by Frietjes in topic Just some ideas
Just some ideas
Great and useful. Here are some earlier thoughts.
0. Change name to e.g. module:Parameter check, to cover more wide goals. Definitely do not limit to infoboxes.
The parameter whitelist could be a module:Parameter check/data/Template:Foo page for the Draft:Tlno template (module data page). With that whitelist, some extra options are possible:
- 1. Unnamed (positional) parameters could be defined white or black
- 2. Per parameter, an "accept blank input yes/no" switch can be added.
- 3. Per parameter, a more special value check could be performed (numeric, pattern, listcheck).
- 4. Big-issue parameters (black/white) or special interest parameters could have their own category or their own catsort letter.
- 4b. Deprecated parameters can be defined and categorized separate (idea added later).
- 5. Category name automated? Parent cat available (using template name, by "parameter check module" name?)
- Tree suggestion (all are maintenance categories):
- Category:Template foo maintenance categories (could be existing name, any name, host cat for this module outcomes)
- Category:Parameter check categories -- The module's view.
- Category:Parameter checks for template foo -- dedicated for & created through module:Parameter check
- -- Has the default checks (forced adding of the word "pages" makes the name awkward. Better not use title word "articles", because that is to be an option for the template editor).
- Category:Foo template parameter 'country' checks -- special checks
- Category:Foo template parameter '1=' checks --spcial checks
6. We could add a maintenance tag to the pages, demo Draft:Tlno:
Lorem {{do something|latincehck=ipsum}} foo.
→ Lorem ipsum[unknown parameter] foo. Currently in {{convert}}: 12 kilometres ([convert: unknown unit]).
7. Note: As always, categorising a wikilabel works out bad. Say the template is used in the {do something} template, which is used like this:
[[Mercury (element)|{{do something|Mercury}}]]. When the category name is expanded into the page including a category name, it shows like this in the article: [[Mercury (element)Mercury blabla foobar]]. The template could have a "|parametercheck this instance=no
option (the offended page must be edited for this).
8. Options for (easy) ns differentiation please.
9. Catsort could be [[Category: ... |__VALUE__, {{PAGENAME}}]]
-DePiep (talk) 08:04, 25 March 2014 (UTC)
- I like the idea of loading the required parameters from a module data page, rather than using frame args and parent frame args. This option will be much better performance-wise, especially for templates that are called many times on one page. (This is assuming we are loading the data with mw.loadData.) — Mr. Stradivarius ♪ talk ♪ 08:53, 25 March 2014 (UTC)
- Agree. Even more: it allows for unlimited parameter sub-specifications. Each whitelist parameter can have its own check-properties, like "is deprecated", to be used. Also, an "is blacklisted=yes" property can be added for notorious bad parameters). -DePiep (talk) 10:19, 25 March 2014 (UTC)
- feel free to create a more general version as suggested. this was just a first iteration at solving a specific problem. in response to point 7, I modified it to clobber non-whitelisted characters from the VALUE parameter. the list of valid characters could be expanded, and what the clobbered characters are replaced by, but this seems to work for sorting purposes. again, feel free to fork/pilfer/modify this module to create something better. I won't care if it is replaced by something better and deleted. Frietjes (talk) 15:33, 25 March 2014 (UTC)