Edgewall Software

Changes between Version 41 and Version 42 of TracDev/Proposals/AdvancedWikiFormatting


Ignore:
Timestamp:
Jun 10, 2011, 8:40:31 PM (13 years ago)
Author:
Christian Boos
Comment:

a few clean-ups in the #Transclusion section

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/AdvancedWikiFormatting

    v41 v42  
    209209}}}
    210210
    211 Alternatively, the default content of the include processor could be made available to the  wiki variables present in the template in a special variable, e.g. "INCLUDE_CONTENT".
    212 
    213 Variable expansion could also be done using a dedicated syntax (e.g. `@INCLUDE_CONTENT@`, like [MoinMoin:HelpOnVariables MoinMoin] or [http://www.dokuwiki.org/plugin:templater plugin:templater] in dokuwiki), the `{{{...}}}` style of MediaWiki conflicts with our inline verbatim style.
    214 
    215211The Template:ReleaseInfo page would have the following content:
    216212{{{
     
    220216 }}}
    221217}}}
     218
     219Alternatively, the default content of the include processor could be made available to the  wiki variables present in the template in a special variable, e.g. "INCLUDE_CONTENT".
     220
     221{{{
     222{{{#!include page="Template:ReleaseInfo2" version="1.0"
     223 This version is feature complete, mind you.
     224  - all existing tickets are implemented
     225  - there are no known (or unknown) bugs
     226  - there's even no feature left to be implemented, all is there
     227}}}
     228}}}
     229
     230The Template:ReleaseInfo2 page would have the following content:
     231{{{
     232 Version:: @version|unknown@
     233 Description:: @INCLUDE_CONTENT@
     234}}}
     235
     236Variable expansion could also be done using a dedicated syntax (e.g. `@@`, like [MoinMoin:HelpOnVariables MoinMoin] or [http://www.dokuwiki.org/plugin:templater plugin:templater] in dokuwiki), the `{{{...}}}` style of MediaWiki conflicts with our inline verbatim style.
    222237
    223238Instead of `#!param`, we could also use `!#define` to create a variable that could be used in the document itself, or rather in the current scope.
     
    242257 - `[[Include(#ReleaseInfo, version=2.0, description=not there yet)]]`
    243258 - `{{#ReleaseInfo|version=2.0|description=not there yet}}` (MediaWiki:Help:Template)
    244 Note that `.#abc` and `#abc` are targeting the same node.
     259Note that `.#abc` and `#abc` are targeting the same node. XXX Maybe even only use `abc` here?
    245260
    246261"Define" could also be used for much small repetitive text, like repetitive URLs, when one doesn't want to define an InterWiki prefix for it, e.g.
    247  -
    248 `[[Define(issue=http://bugs.python.org/issue@1@)]]` and `{{issue|1234}}`
    249  - `@issue=http://bugs.python.org/issue{{1}}@` (?)
    250  - `@issue=http://bugs.python.org/issue@` and `@issue@1234` (?)
     262 - `[[Define(issue=[http://bugs.python.org/issue@1@ Issue @1@])]]` and `[[Include(issue, 1234)]]`
     263 - `{{issue=[http://bugs.python.org/issue@1@ Issue @1@])]]` and `{{issue|1234}}`
     264 - `@issue=[http://bugs.python.org/issue{{1}} Issue {{1}}]@` and `@issue|1234@`
     265
     266
    251267
    252268In summary, we would have the following constructions:
     
    278294
    279295A technical difficulty with the short form for transclusion `{{...}}` is the need to handle the nesting of `{{...}}` pairs, to allow for multiple level of expansion, like shown in [http://meta.wikimedia.org/wiki/Help:Advanced_templates advanced templates] in MediaWiki.
    280 
    281 The `<name>` parameter given to includes should itself be subject to expansion , and if this corresponds to an unbound variable, the inclusion will be dynamic (parsing deferred to the formatting stage).
    282 //Or should parsing always be deferred?//.
     296One level can easily be taken care of by using both the `{{...}}` and `@...@` styles.
     297
     298The `<name>` parameter given to includes should itself be subject to expansion , and if this corresponds to an unbound variable, the inclusion will be dynamic.
    283299
    284300Recursion should be detected (//trying to include `<name>` when `<name>` is already in the stack of includes//) and prevented (//as if `<name>` was missing, i.e. replaced by nothing or the given `default` value//).