Changes between Version 3 and Version 4 of marcink

Feb 12, 2017, 9:23:50 AM (6 years ago)
Ryan J Ollos

Content moved from wiki page.


  • marcink

    v3 v4  
    11= marcink
    3 [[ListTagged(marcink)]]
     3[[PageOutline(2,Page Index)]]
    5 == Pages I Created ==
     5= My (MarcinK's) Search For The Ultimate Wiki Template Macro =
    7  * SearchForUltimateWikiTemplateMacro
     7This page outlines my findings as I am searching for a what I believe to be the ultimate wiki template macro
     10== Features of Ultimate Wiki Template Macro ==
     12What am I looking for?
     14 1. Works with Trac 1.0
     16 2. The ability to store portions of page content in another wiki page, and include them in current page, with them being rendered in current page's context.  This is similar to the IncludMacro, but IncludMacro renders the template content in the context of the template wiki page.
     18 3. The ability to pass named parameters to the macro call (i.e. `ParamName=param_value`, and have the macro replace every instance of something like `{{ParamName}}` with the passed `param_value`).  This is very similar to (...fill in macro names...), but the mentioned macros use a sequence of parameters and replace `{{1}}`, `{{2}}`, etc., instead of named parameters.  Desired use example: `[[UltimateTemplateExpand(TemplateName,ParamOne=value_one,ParamTwo=value two,ParamThree=value_three)]]`.  This also needs a mechanism of 'escaping' markers so that they would not be expanded.
     20 4. The ability to have some of the environment content available for auto expansion in the macro.  For example, being able to insert the wiki page's name into the template as it is being expanded.  This could be done in a number of possible ways, some of which are:
     22      a) Being able to specify special `param_value` in the macro invocation syntax, for example: `[[UltimateTemplateExpand(TemplateeName,PageName=&env.PageName)]]`
     24      b) Being able to directly reference an environment variable in the template using something like `{{&env.PageName}}`.  However, I see this as less desirable as it would require more compute-intensive processing, where all patterns of text in double curly braces would have to be processed.  Previous option still allows global replace of only known patterns.
     26 5. The ability to specify ''page !global'' variables for the template expansion.  This means that starting a wiki page with something like `[[UltimateTemplateVars(VarName=value,VarName2=value2)]]` would expand "VarName" and "VarName2" in all subsequent calls to UltimateTemplateExpand, but in the current page only.
     28== Research ==
     30Here are my notes on what I found, what works, and what does not. 
     31I also posted a related [[|question on Stack Overflow]].
     33=== IncludeMacro ===
     35TODO: add finding RE IncludeMacro
     37=== WikiIncludePlugin ===
     39TODO: add findings RE WikiIncludePlugin
     41=== TracWikiTemplates Plugin ===
     43TODO: add finidngs RE TracWikiTemplates Plugin
     45=== PageVariableMacro ===
     47Thanks to ''hasienda'' on Stack Overflow for pointing out the PageVariableMacro.
     49What Works:
     50 * This is an example of having page wide variables (requirement 5)
     52What Does Not Work:
     53 * This is an older macro that is reported to not work with Trac 0.11, breaking requirement 1.
     55=== ParameterizedIncludeMacro
     57//Published to trac-hacks on 2015-01-19//.
     59This is a nice and simple macro.
     61What Works:
     62 * Allows expansion of a template and works in Trac 1.0 (requirement 1 and at least part of 2 met)
     64What Does Not Work:
     65 * Uses sequenced (numbered) placeholders instead of named ones (fails requirement 3)
     67What's Pending Testing:
     68 * If the template page is rendered (Wiki interpreted) in the context of the template page or the page calling it