Page MenuHomePhabricator

Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision slot
Open, HighPublicFeature

Description

e.g. Template:Information could be documented at TemplateData:Information instead of inside the source code of Template:Information.

Pros:

1. More standard use of ContentHandler for JSON across projects
2. Document templates without needing to make edits to templates that are potentially transcluded across large swaths of pages
3. Easier to implement custom editors for ContentHandler pages than for portions of wikitext pages.

Cons:

1. Would need to have two separate systems - one for the JSON storage, then another to transclude the generated documentation onto template doc pages, e.g. with <templatedata /> or {{#templatedata}} or so (no params needed, because the TemplateData namespace page can be of the same name, like a talk page)
2. Would need to rework the existing editor (sorry, mooeypoo) to work with the new system


Version: master
Severity: enhancement
See Also: T52512: TemplateData: Page properties should not be stored twice (both Template and Template/doc)

Details

Reference
bz54140

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
OpenNone
Opendaniel
OpenNone
Resolvedbrion
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
OpenNone
OpenNone
Resolvedawight
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedovasileva
StalledNone
ResolvedAmmarpad
OpenNone
StalledNone
OpenNone
Resolvedphuedx
OpenNone
Resolvedovasileva
Resolved marcella
Resolvedmatmarex
ResolvedBUG REPORTEsanders
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
OpenNone
Resolved jkroll
StalledFeatureNone
OpenNone
StalledNone
Resolveddaniel
ResolvedJdforrester-WMF
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
OpenKizule
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Resolveddaniel
OpenNone
OpenNone
Opendaniel
Resolveddaniel
Invaliddaniel
DuplicateNone
ResolvedAnomie
ResolvedAnomie
ResolvedAnomie
Resolved Addshore
Resolveddaniel
ResolvedAnomie
ResolvedNone
DuplicateNone
Resolveddaniel
Resolved Addshore
Resolveddaniel
ResolvedMarostegui
Resolved Addshore
ResolvedMarostegui
Resolved Tgr
DuplicateNone
Resolved Addshore
Resolveddaniel
OpenNone
Resolvededwardspec
OpenNone
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolved Tgr
Resolved Tgr
Resolved Tgr
ResolvedBstorm
ResolvedCCicalese_WMF
ResolvedNone
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
OpenNone
Resolveddaniel
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedPRODUCTION ERRORUmherirrender
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedPeter.ovchyn
Opendaniel
Resolveddaniel
OpenNone
OpenZabe
OpenNone
OpenLadsgroup
ResolvedBUG REPORTZabe
ResolvedPRODUCTION ERRORZabe
OpenDreamy_Jazz
StalledNone
OpenNone
Resolveddaniel
OpenNone
ResolvedAnomie
ResolvedAnomie
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Resolveddaniel
Invalid Tgr
ResolvedAnomie
ResolvedAnomie
ResolvedPRODUCTION ERRORFunc
OpenNone
OpenNone
Resolveddaniel
DuplicateNone
ResolvedAnomie
ResolvedAnomie
Resolved Tgr
Resolved Tgr
InvalidNone
Resolveddaniel
Resolveddaniel
ResolvedBPirkle
ResolvedCCicalese_WMF

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:48 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz54140.

I talked about that briefly on IRC, we decided that since this is specifically about the namespace proposal, until we decided what to do about it, we'd leave both open. And closing that bug may not necessarily close this bug.

Krinkle renamed this task from TemplateData: Store TemplateData in its own namespace ("Template data:") with a JSON content type and associated to the Template: namespace to Move TemplateData to its own JSON-content namespace and associate with Template-namespace.May 8 2015, 3:55 AM
Jdforrester-WMF renamed this task from Move TemplateData to its own JSON-content namespace and associate with Template-namespace to Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision stream..Jan 15 2016, 9:27 PM

I've fiddled with this because either T487: RfC: Associated namespaces or T107595: [RFC] Multi-Content Revisions would both meet this need. I think the latter is both more likely to occur and a better outcome, but…

I do raise two issues against the proposal, at least for mandatory evaluation of JSON pages only.

  • Pro #2 reads as: “Document templates without needing to make edits to templates that are potentially transcluded across large swaths of pages”
    • This goes for any kind of lengthy documentation, and is usually solved by transclusion of a separated /doc into main template page.
    • German Wikipedia is using that technique for any longer template documentation since 2008, and enforces TemplateData on separated docpage for all productive templates.
  • There are JSON objects built by template-like transclusion via {{#tag:}} syntax.
    • See Kategorie:Vorlage:Metadokumentation on German Wikipedia – a dozen of so-called “meta documentation” pattern pages is generating nearly thousand TemplateData objects on particular template pages, controlled by template name and sometimes parameters.

Optional separated .json subpages may be introduced, but classic <templatedata> approach needs to be supported, too.

This could be held like doc subpages or currently deployed css subpages instead

Jdforrester-WMF renamed this task from Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision stream. to Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision slot.Oct 31 2018, 3:16 PM
  • There are JSON objects built by template-like transclusion via {{#tag:}} syntax.
    • See Kategorie:Vorlage:Metadokumentation on German Wikipedia – a dozen of so-called “meta documentation” pattern pages is generating nearly thousand TemplateData objects on particular template pages, controlled by template name and sometimes parameters.

Interesting. json-schema allows referencing/embedding other schemas by using a special "$ref": "[URI to another schema]" key. Maybe something like that could be implemented in TemplateData instead of requiring the use of parser functions.

Please note that these are not static pages.

  • The URI comment looks like assigning a static page which is simply transcluded.
  • Entire JSON TemplateData descriptions are generated individually by template or Lua programming; depending on parameters and existence of other pages.
  • You may have a look e.g. at use of lang/Latn/Doku and the derived page.

See related approach by Module:TNT -- it stores templatedata as a table (example). In this case <templatedata> will be dynamically generated during the parse time, and is available to every language/every wiki.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Aklapper removed a subscriber: TrevorParscal.