Context
Editors using wikitext have long criticized the auto-generated references naming pattern :n (e.g. :0, :1) for being cryptic and a meaningless identifier. We ran a RfC on meta to gather community consensus on improving the naming pattern. The RfC showed support for a content-based naming solution (richer, more descriptive names). We're delivering this incrementally, starting with a simpler foundation and building upwards toward that goal.
Solution Approach
We are solving this in three increments:
- Replace the :n pattern with a human-readable default: Every newly auto-generated reference name, regardless of reference type, will follow a localized pattern like reference-n (e.g. einzelnachweis-n on German Wikipedia). Community members will also get a way to override this default with their own preferred name. Exact default names and override mechanism will be defined in sub-tasks of this epic. Our hypothesis is that this alleviates the pain, even if only minimally, and establishes one of the fallbacks needed for the next increments. => T430052: [Epic] Autonames increment 1: Replace the :n pattern with a human-readable default
- Support content-based references patterns (e.g. {{cite book}}): Communities will be able to create a custom template that defines the citation details to be used for generating the reference name, minimizing how often references fall back to the generic default name from increment 1. This also provides higher agency and flexibility for the communities => T430131: [Epic] Autonames increment 2: Support content-based references patterns
- Support URL-based patterns for basic references (plain <ref> tags without templates): Names will be derived from the reference's URL where possible based on what the community configured. => (Out of Scope atm)
Deployment approach
The new naming scheme can be enabled via community configuration page, giving both the community autonomy in when they enable the feature. See T436255: 1️⃣ Community Configuration: Enable admins to turn on the new Visual Editor auto-generated reference names for their wikis (M)
Hard requirements - what stays the same:
- The current trigger condition for auto-naming will remain unchanged. This means that a name is only generated the first time a reference is reused (or a sub-reference is created) in Visual Editor, and only if no name already exists.
- We will keep same publish mechanisms untouched. The reference name will appear in Visual Editor only upon publishing and re-entering Visual Editor or switching between wikitext and Visual Editor.
- We will not modify existing reference names already in articles.
- The mechanism for adding autonames to a reference in wikitext does not change; same place, same logic.
- Reference name should be visible in Visual Editor re-use dialog, when the document is saved and reloaded
- The reference name can be previewed in the Wikitext preview
Out of scope:
- VisualEditor UI changes for manually assigning names
- Retroactively updating existing :n names already in articles
Internal docs: