Changes between Version 3 and Version 4 of marcink


Ignore:
Timestamp:
Feb 12, 2017, 9:23:50 AM (4 years ago)
Author:
Ryan J Ollos
Comment:

Content moved from wiki page.

Legend:

Unmodified
Added
Removed
Modified
  • marcink

    v3 v4  
    11= marcink
    22
    3 [[ListTagged(marcink)]]
     3[[PageOutline(2,Page Index)]]
    44
    5 == Pages I Created ==
     5= My (MarcinK's) Search For The Ultimate Wiki Template Macro =
    66
    7  * SearchForUltimateWikiTemplateMacro
     7This page outlines my findings as I am searching for a what I believe to be the ultimate wiki template macro
     8
     9
     10== Features of Ultimate Wiki Template Macro ==
     11
     12What am I looking for?
     13
     14 1. Works with Trac 1.0
     15 
     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.
     17
     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.
     19
     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:
     21
     22      a) Being able to specify special `param_value` in the macro invocation syntax, for example: `[[UltimateTemplateExpand(TemplateeName,PageName=&env.PageName)]]`
     23
     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.
     25
     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.
     27
     28== Research ==
     29
     30Here are my notes on what I found, what works, and what does not. 
     31I also posted a related [[http://stackoverflow.com/questions/25530285/inline-template-expansion-macro-for-trac|question on Stack Overflow]].
     32
     33=== IncludeMacro ===
     34
     35TODO: add finding RE IncludeMacro
     36
     37=== WikiIncludePlugin ===
     38
     39TODO: add findings RE WikiIncludePlugin
     40
     41=== TracWikiTemplates Plugin ===
     42
     43TODO: add finidngs RE TracWikiTemplates Plugin
     44
     45=== PageVariableMacro ===
     46
     47Thanks to ''hasienda'' on Stack Overflow for pointing out the PageVariableMacro.
     48
     49What Works:
     50 * This is an example of having page wide variables (requirement 5)
     51
     52What Does Not Work:
     53 * This is an older macro that is reported to not work with Trac 0.11, breaking requirement 1.
     54
     55=== ParameterizedIncludeMacro
     56
     57//Published to trac-hacks on 2015-01-19//.
     58
     59This is a nice and simple macro.
     60
     61What Works:
     62 * Allows expansion of a template and works in Trac 1.0 (requirement 1 and at least part of 2 met)
     63
     64What Does Not Work:
     65 * Uses sequenced (numbered) placeholders instead of named ones (fails requirement 3)
     66
     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