User:Cscott/Ideas/A Plan for Global Templates

Apologies if you can here via a link which promised "some of my own ideas": this is a work in progress, and more of a collection of outline topics and notes-to-self than a coherent proposal for now. But if you're interested, contact me and I can probably spin these into a proper proposal.

Separating code from data from content

 * ref previous talks, ArrayFunctions
 * a composable type system for transclusions

Everything localizable

 * ref previous talks, babeljs, multilingual lua

More hooks from articles
Not just "the data object for an article" and "the code module for an article" but also "the layout" for an article -- and make this extensible! In some sense this is what "subpage" is for, but I want better UX and tabs and maybe orthogonal axes, although we can get pretty far with  (the spanish translation of the documentation for the code module for article  ).

Remove one to add one
Any new template mechanism must be powerful/compatible enough to completely replace one of our four-ish existing mechanisms. We can't just keep building new things, we must provide some transition mechanism (build incrementally, or provide translators, or...) that would prevent this from just adding "one more (unmaintained) template mechanism" to MediaWiki.

Fragment composition and memoization
Composition *should not* be turing-complete! (But it's so easy to make a turing-complete system without trying hard...)

Each fragment renderer should be able to register dependencies in a uniform manner, aka generate an appropriate hash key for memoization; also register time-dependency, indeterminancy, etc.

Translate

 * UX for translating template information; ie support for TemplateData (and/or wikifunctions or whatever the backend is)

Scribunto

 * Migration tools from Lua 5.1, starting with a parser (2024 update: I have a parser now)
 * Prototype "localizable lua" (2024: I've begun a prototype)
 * Prototype "visual scribunto"
 * Separate tabs for "code", "doc", "data", "layout", etc.
 * "Selectable runtimes"
 * one-click export from scribunto to wikifunctions (or to lua 5.3 or to localizable lua, etc)

TemplateData

 * parser function/extension unification (also: input/output types!)
 * prototype embedded semantic data

Core

 * unified Template UX w/ subpages
 * Versioning: "import from git" or "automatically import from git"