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, HighPublic

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

Event Timeline

bzimport raised the priority of this task from to High.
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.

He7d3r updated the task description. (Show Details)Feb 22 2015, 10:07 PM
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.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 4 2015, 2:10 PM
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…

JJMC89 added a subscriber: JJMC89.May 1 2016, 8:26 AM
Danny_B added a subscriber: Danny_B.
PerfektesChaos added a subscriber: PerfektesChaos.EditedMar 30 2017, 1:30 PM

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

Mvolz added a subscriber: Mvolz.Aug 24 2017, 2:20 PM
Krinkle removed a subscriber: Krinkle.May 16 2018, 4:46 PM
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.
Yurik added a subscriber: Yurik.Dec 20 2018, 9:07 PM

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.