In the second increment of the autoname improvements we want to enable the community to create an autoname pattern for templated references.==== Context
User Story
========In the second increment of the autoname improvements we want to support the auto generation of reference names from Citation template content and enable the community to create patterns on how this content will be used.
As a Wikipedia editor,==== User Story
As a Wikipedia VE user,
I want reference names to be generated from citation content when possible,structured Citation template content when possible,
so that I can more easily understand, identify, and reuse references in Wikitext without relying on generic auto-generated names.
so that I can more easily understand, identify, and reuse references in wikitext without relying on generic auto-generated names.
==== Acceptance Criteria
===============[] Autonames can be generated from the parameter values of a template transclusion in the reference.
[] Communities can configure naming patterns for supported reference typestemplates.
[] Communities can define a fallback chain of naming patterns for each reference typetemplate.
[] When a new reference name is generated, the system evaluates the configured patterns in order until a valid name can be produced.
[] If no configured pattern can generate a valid name, the system falls back to the default naming pattern introduced in Increment 1.
[] Generated names remain unique within the pagegroup.
[] Existing references continue to function unchanged.
Technical implementation==== Limitations
- Only single template transclusions are valid for this use case otherwise we fall back to the default naming pattern
==== Technical implementation
- TemplateData needs to be used for the templates.
- We're adding another map to the TemplateData of these templates
- The patterns consist of references to parameter names mixed with delimiter content
- Fallbacks can be added underneath each other
e.g.
```
{
"params": {
"title": {
"type": "line",
"suggested": true
},
"author": {
"type": "line",
=================== "suggested": true
},
"year": {
"type": "line",
"suggested": true
}
},
"maps": {
"autonames": [
"$author-$year",
"$author",
"$title-$year",
"$title"
]
}
}
```
==== Open questions
It would make sense to add- How do we normalize the configuration to the template definition. Example:tent for the names?
{F90425696}- Do we normalize names to lowercase?
- What's the length threshold, and how do we cut?