User:Dantman/Formal template system

From mediawiki.org


  • On the template edit page you have an option to declare the template as a WikiText template or a Lua template.
  • If you choose WikiText you will have the additional capability to define extra blobs of WikiText. You will be able to transclude these into the main body of the template without needing to define separate pages for the template.
  • Documentation is separate from these blobs. You will be able to edit it on it's own and it will not be necessary to use <noinclude> tags in the body.
  • Besides the documentation you may also have a few separate blobs you can enter:
    • Description: This is meant to be short unlike the documentation. This formal template system will have a special page usable for finding templates which may make use of this description to inform people about the template.
    • Examples: There will be a blob area capable of being inputted with some WikiText for example uses of the template. The special page may also show some of these for users.
  • A template also has access to an i18n system. The English body is declared in-context along with a message key. A separate interface is provided to allow the template to be localized into other languages. (These DO NOT use subpages)
    • Since these are intended to be scoped to the template and we don't really need as many we won't use an interface like we do for the i18n messages in the MediaWiki: namespace. All the messages should be visible at once and one should be able to easily translate them all from the same interface.
    • Consideration should also be made for when the primary body changes it's content. We should have an option that will make it easy for translators to see just these ones. As well we should show them what changed in the original message. We may want to have some sort of inline diff. One where we display the block of WikiText in source form and use styled <del> and <ins> tags to indicate what portions were modified.
  • We may add that AuthorizedCSS extension idea to this as well. It would allow template specific css to be defined along with the template and then authorized by an administrator.
  • One goal of this is for templates to be completely contained. It should be very easy to export every piece that is needed for one template into a single component and then import it somewhere else. Though for some things like infoboxes we may want to provide a simple dependency system to allow some things like css to be shared between templates.