Page MenuHomePhabricator

[Epic] Autonames increment 2: Support content-based references patterns
Open, Needs TriagePublic

Description

Context

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.

User Story

As a Wikipedia VE user,
I want reference names to be generated from 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.

Acceptance Criteria
  • Autonames can be generated from the parameter values of a template transclusion in the reference.
  • Communities can configure naming patterns for templates.
  • Communities can define a fallback chain of naming patterns for each template.
  • 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 group.
  • Existing references continue to function unchanged.
Limitations
  • Only single template transclusions are valid for this use case otherwise we fall back to the default naming pattern
Technical implementation

Different implementations are possible:

  1. Template that creates an autoname (could use Lua)
  2. Autoname pattern in Template Data
  3. Community configuration

See overview table (open for review).

We decided that we will continue with the first option and store the link to the autoname pattern template somewhere.

There are also different options to store these: Overview table (open for review).

NOTE: The following notes handle option 2 and are therefore currently outdated.
  • 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 ("params" is already part of template data, "autonames" would be added)

e.g.

{
	"params": {
		"title": {
			"type": "line",
			"suggested": true
		},
		"author": {
			"type": "line",
			"suggested": true
		},
		"year": {
			"type": "line",
			"suggested": true
		}
	},
	"autonames": [
		["author", "-", "year"],
		["author"],
		["title", "-", "year"],
		["title"]
	]
}
Open questions
"autonames": [
		["author", "-", ["date", "transform", "year"]],
		["author"],
		["title", "-", ["date", "transform", "year"]],
		["title"]
	]
  • Would users want an overview of all autoname definitions?
  • Would they want to have the same definition for multiple templates?
  • Would the name of the template also be a wanted building block?
  • Do we do normalization to the content for the names, lowercase or cut?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
lilients_WMDE updated the task description. (Show Details)