Submissions/Templates are dead! Long live templates!

This is an accepted submission for Wikimania 2015.

Submission no.
3044
Title of the submission
Templates are dead! Long live templates!
Type of submission (discussion, hot seat, panel, presentation, tutorial, workshop)
presentation
Author of the submission
C. Scott Ananian (cscott)
E-mail address
cananian@wikimedia.org
Username
cscott
Country of origin
USA
Affiliation, if any (organisation, company etc.)
Wikimedia Foundation
Personal homepage or blog
http://cscott.net
Abstract (at least 300 words to describe your proposal)

Templates are fantastic! A strong and flexible template system has enabled Wikipedia to become what it is today. Templates have become the way that we create citations, reference lists, infoboxes, navboxes, article talk page banners, "see also" portals, books, notifications about administrative issues and how we adjust image size and table formatting. Templates like {{Citation needed}} have even entered popular culture.

But the power of templates has a dark side. They are an intimidating barrier to entry for new editors. Important semantic markup and data is hidden inside infobox, navbox, and portal templates. The prevalent use of templates which generate wikitext fragments impairs the use of WYSIWYG editors on our articles. Templates frequently present barriers to accessibility. On top of everything, templates have a baroque wikitext syntax with incantations like {{!}}, {{=}} and {{{test{{{test|}}}|{{{then}}}}}} to trap or befuddle the unwary. Certain content can not easily be passed as arguments to templates, and whitespace issues abound.

We need to partially roll back the tide, and come up with ways to clearly express semantic information about an article without resorting to the awesome power of a fully unrestricted unstructured template engine.

In this talk I briefly describe four ways this can be done:

  1. Creating "well-structured" templates. Templates can be annotated with metadata to make their contents more easily editable with Visual Editor. We can also restructure templates so that they emit complete constructs, instead of wikitext fragments. We can create new syntax to make it easier to move content into template arguments without baroque quoting rules.
  2. Generating infoboxes and navboxes automatically from wikidata. This reduces duplicated work among projects, and allows all our Wikipedias to benefit from new data. Editors who would previously correct an info box can directly update wikidata, again providing machine-readable information to all projects. We'll present Jon Robson's implementation for wikidata infoboxes.
  3. Powerful image styles. Many uses of templates are attempting to apply consistent styles to images. For example, on nlwiki they wish to have two separate "standard" thumbnail sizes, which our core software does not support. We propose a stronger image styling mechanism in core to make it possible to style images consistently without the use of templates. As a bonus, this can provide more useful semantic metadata about the role of the image in the page. (Perhaps an extension of this mechanism could provide article, section, or paragraph styles.)
  4. Separating code, data, and presentation in Scribunto. Scribunto strengthens our ability to write complex templates that remain readable. But we can do better: by properly separating concerns and operating on a DOM instead of wikitext strings we can make it easier to generate well-formed output and also easier to edit the code, data, and presentation independently, including using Visual Editor to edit the presentation and layout associated with a template.

I hope that in this way we can begin to reign in the indiscriminate use of templates, replacing them with tools more accurately fitted to the tasks at hand.

Track
  • Technology, Interface & Infrastructure
Length of session (if other than 30 minutes, specify how long)
30 minutes
Will you attend Wikimania if your submission is not accepted?
Yes.
Slides

Technical talk given at Wikimania 2015 in Mexico City.

https://docs.google.com/presentation/d/1capwgnekmxKMaonNOG7G4uZVJno0-eGP9tOAJBolq9U/edit

Special requests

Shouldn't conflict with other Parsoid team talks (Submissions/Wikitext_is_broken,_long_live_wikitext_(2.0); will add others if the team submits more talks).

This might go well in a session with Submissions/Future of structured documents: VisualEditor, Citations and Wikidata, oh my!, which is another attempt to reduce the need for templates and express more semantic information about the article.


Interested attendees

If you are interested in attending this session, please sign with your username below. This will help reviewers to decide which sessions are of high interest. Sign with a hash and four tildes. (# ~~~~).

  1. Sage (Wiki Ed) (talk) 07:03, 28 February 2015 (UTC)[reply]
  2. Daniel Mietchen (talk) 12:24, 28 February 2015 (UTC)[reply]
  3. SSastry (WMF) (talk) 17:24, 28 February 2015 (UTC)[reply]
  4. NavinoEvans (talk) 13:25, 2 March 2015 (UTC)[reply]
  5. Sounds related to Submissions/Making Infoboxes easier to edit and maintain with the help of Wikidata. Amir E. Aharoni (talk) 16:15, 6 March 2015 (UTC)[reply]
  6. Tar Lócesilion (talk) 23:27, 9 March 2015 (UTC)[reply]
  7. CT Cooper · talk 22:18, 10 March 2015 (UTC)[reply]
  8. Quiddity (WMF) (talk) 04:23, 26 March 2015 (UTC)[reply]
  9. --Adert (talk) 14:47, 19 April 2015 (UTC)[reply]
  10. --Roxyuru (talk) 12:53, 21 May 2015 (UTC)[reply]
  11. eranroz (talk) 08:14, 4 July 2015 (UTC)[reply]
  12. --Ilya (talk) 15:55, 15 July 2015 (UTC)[reply]
  13. Darafsh Kaviyani (Talk) 20:28, 18 July 2015 (UTC)[reply]