Please find some suggestions below.
- The current concept of rights and skins and target etc. shall be extended.
- The aim is similar to T63007 and perhaps in other places.
- However, the syntax is extended within the current style.
- Packaging shall be based on properties which can be evaluated immediately on loading.
- The target is to avoid loading of meaningless modules, therefore each rule is further limiting the scope of gadgets required within the current page under current conditions.
- In cache some more module packages will be founded per site, but repeating the same aggregation.
- The rules still follow a simple AND combination. Some might wish an entire boolean language, but no implementation expected within this century.
Separators
Currently comma separation only is expected for multi-value.
- Introduce space separator as regular syntax as well.
- Keywords are simple ASCII words with no space inside, dependencies with dot, sometimes hyphen.
- Tokenization is rather easy then, and quite usual.
- Trimming between equal sign and pipe is no big deal.
- Comma+space should not disturb anywhere.
- Even ⇥ may be used instead of space, or any whitespace.
That would improve readability.
Boolean considerations
- If one keyword= rule is given, multiple items open an OR choice if not excluding.
- All rules need to be matched, they form an AND expression.
- A keyword= rule may occur multiple times (with other items). That is an AND junction of their items.
- If items are prefixed with - this is an exclusion rule and all exclusions are to be met.
Namespace
Syntax:
namespaces=
Value is separated list of namespace numbers.
- If element starting with - that might be exclusion rule.
Example:
|namespaces=14|
Load on category pages only. Otherwise the gadget will always start, first check namespace, abort immediately on most pages.
Special pages
Syntax:
specials=
Value is separated list of special page name keywords, case insensitive.
- Keyword could be specialpages if desired, but only one of them.
Example:
|specials=Recentchanges,Watchlist,EditWatchlist|
Action
Syntax:
actions=
Value is separated list of &action= keywords.
- edit shall cover submit as well.
- If editing is not permitted to this user, view might be required and edit is bounced back (no editing tools meaningful).
- If element starting with - that might be exclusion rule.
- Some special pages are rewriting themselves into action=, e.g. Diff. That needs to be considered. It depends on the moment when the current situation is resolved.
Example:
|actions=view,edit,parsermigration-edit|
Do not load on history or info.
Content model
Syntax:
contentmodels=
Value is separated list of case insensitive content model names.
Example:
|contentmodels=css|
Run linter etc. on appropriate language only. Or limit to wikitext editing.
Page properties
Syntax:
pageprops=
Value is separated list of case insensitive pageprop names.
- If element starting with - that might be exclusion rule (AND NOT).
Example:
|pageprops=templatedata| |pageprops= -disambiguation -wikibase_item|
- If TemplateData is present on this page, then link some keywords and add nice formatting.
- If this article is not linked to WikiData and it is no disambiguation page then remind to look for WikiData item or create one if topic is appropriate.
Transcluded page
Syntax:
transcludes=
Value is whitespace separated list of page names with underscore _ rather than space.
- If element starting with - that might be exclusion rule (AND NOT).
Example:
|transcludes=Template:citation_needed|
If that template is transcluded, load a gadget to find reliable sources.
Category
Syntax:
categories=
Value is whitespace separated list of category titles (no leading namspace Category:), with underscore _ rather than space.
- If element starting with - that might be exclusion rule (AND NOT).
Alternative approach to transcludes= rule.
Example:
|categories=Wikipedia:Gadgets/Talk_utilities|
If current page is within that category, load a gadget to support discussions. Multiple templates might trigger such hidden category.
This approach has a certain risk to be misused for attacks, or editors are not aware of undesired effects triggered by categories. transcludes= is much safer.
User groups
Syntax:
groups=
Value is separated list of case insensitive user group names.
- If element starting with - that might be exclusion rule (AND NOT).
- all is not required but basic set anyway. Members may be subtracted.
Examples:
|groups=sysop| |groups=-user| |groups=user -sysop|
The second one is matching anonymous users. The third one are registered accounts, but might be not too experienced and powerful.
User language
Syntax:
userlangs=
Value is separated list of case insensitive language codes.
- If element starting with - that might be exclusion rule (AND NOT).
- Current user language pt-BR shall match |userlangs=pt|.
Example:
|userlangs=en-US,fr,zh-Hant,simple|
Shall exploit right-to-left scripting, translation helpers, special letter support, spellchecking etc.
Content language
Syntax:
contentlangs=
Same as userlangs but for page content language.