Changes between Version 41 and Version 42 of TracDev/Proposals/AdvancedWikiFormatting
- Timestamp:
- Jun 10, 2011, 8:40:31 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/Proposals/AdvancedWikiFormatting
v41 v42 209 209 }}} 210 210 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 215 211 The Template:ReleaseInfo page would have the following content: 216 212 {{{ … … 220 216 }}} 221 217 }}} 218 219 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". 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 230 The Template:ReleaseInfo2 page would have the following content: 231 {{{ 232 Version:: @version|unknown@ 233 Description:: @INCLUDE_CONTENT@ 234 }}} 235 236 Variable 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. 222 237 223 238 Instead 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. … … 242 257 - `[[Include(#ReleaseInfo, version=2.0, description=not there yet)]]` 243 258 - `{{#ReleaseInfo|version=2.0|description=not there yet}}` (MediaWiki:Help:Template) 244 Note that `.#abc` and `#abc` are targeting the same node. 259 Note that `.#abc` and `#abc` are targeting the same node. XXX Maybe even only use `abc` here? 245 260 246 261 "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 251 267 252 268 In summary, we would have the following constructions: … … 278 294 279 295 A 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?//.296 One level can easily be taken care of by using both the `{{...}}` and `@...@` styles. 297 298 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. 283 299 284 300 Recursion 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//).