W3TPL/tags: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
m (→‎Overview: replaced nowiki with xmltag)
(→‎Overview: MW parser can't do nested tags)
Line 3: Line 3:


In order to get around the parser, most of these tags have ways of using internal data for their values rather than depending on the parser to get things in the right order. ''to be documented''
In order to get around the parser, most of these tags have ways of using internal data for their values rather than depending on the parser to get things in the right order. ''to be documented''
One of the weaknesses of the MediaWiki parser is that it cannot deal with nested tags properly; the ending-tag of a tag-pair nested inside another tag-pair results in closure of the ''outer'' tag-pair as well, and any text past the internal closing-tag is displayed rather than being passed to the tag handler. W3TPL allows you to get around this limitation by defining ''functions'' which are parsed separately from the code-block in which they are executing.


==Tags==
==Tags==

Revision as of 23:11, 18 September 2008

Overview

Although the main "meat" of W3TPL is the (as-yet-unfinished) parser for text within Template:XmltagTemplate:Xmltag tags, there are a number of other tags which replicate much of the same functionality and may be suitable for simpler tasks.

In order to get around the parser, most of these tags have ways of using internal data for their values rather than depending on the parser to get things in the right order. to be documented

One of the weaknesses of the MediaWiki parser is that it cannot deal with nested tags properly; the ending-tag of a tag-pair nested inside another tag-pair results in closure of the outer tag-pair as well, and any text past the internal closing-tag is displayed rather than being passed to the tag handler. W3TPL allows you to get around this limitation by defining functions which are parsed separately from the code-block in which they are executing.

Tags

  • Text block inclusion:
    • Template:Xmltag: Runs the parser on everything in between the tags, but doesn't display the result. Useful for doing a lot of "programmish" stuff, so you can format it nicely and comment it without messing up your display
    • Template:Xmltag: overrides the "hide" attribute (and eventually the Template:Xmltag tag), i.e. displays contents
    • Template:Xmltag: includes the contents of another page – like templates, but without creating a separate instance of the page object
  • Template:Xmltag, Template:Xmltag: much like PageVars extension, but using XML tags instead of {{#parser}} functions
  • Template:Xmltag: defines a function which can be called with arguments later
  • Control structures:
  • Debugging:
    • Template:Xmltag: show list of all variables (with values) and functions (with code)

Common Attributes