X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/75196e76b627709a6ecae3fa948e1fba7928a5ce..cd51e403dcff5028eb0cdfc72d08f7c9ecf0bea3:/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn diff --git a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn index d55fc0aa8..9616f724f 100644 --- a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn +++ b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn @@ -64,6 +64,16 @@ I'd have to agree that Template::Toolkit is overkill and personally I'm not a fa HTML::Template's HTML-like markup prevents me from editing templates in KompoZer or other WYSIWYG HTML editors. The editor tries to render the template markup rather than display it verbatim, and large parts of the template become invisible. A markup syntax that doesn't confuse editors (such as Template::Toolkit's "[% FOO %]") may promote template customization. The ability to replace the template engine would be within the spirit of ikiwiki's extensibility. --Rocco +> HTML::Template allows the use of `` +> instead of ``, see +> +> for details. I used this PERL regexp to convert my own templates: +> +> s{<\s*(/?TMPL_[A-Z]+)((\s+\w+(=(['"]?)\w+\5)?)+)?\s*/?>}{}gi; +> +> (Quoting it properly to use from the shell command-line is +> nightmarish, write a script with it.) +> --[[RiccardoMurri]] I agree that being able to replace the template toolkit would be a great piece of modularity, and one I would use. If I could use the slot-based filling and the conditional logic from Template::Toolkit, we could build much more flexible inline and archivepage templates that would look different depending on where in the wiki we use them. Some of this can currently be accomplished with separate templates for each use case and a manual call to the right template in the !inline directive, but this is limited, cumbersome, and makes it difficult to reuse bits of formatting by trapping all of that information in multiple template files. -Ian @@ -85,3 +95,21 @@ I agree that being able to replace the template toolkit would be a great piece o >> A modular template system in ikiwiki is unlikely, as template objects >> are part of the API, notably the `pagetemplate` hook. Unless the other >> system has a compatible template object. --[[Joey]] + +>>> I hacked an adapter that exposes the HTML::Template API but uses +>>> Template::Toolkit for the template rendering. Very rough, but it +>>> works: my Wikis compile mostly ok. The code includes a `.tmpl` +>>> converter script. Get it from: +>>> --[[RiccardoMurri]] + +--- + +>>> I found this thing yesterday: +>>> +>>> http://search.cpan.org/~rhandom/Template-Alloy-1.016/lib/Template/Alloy.pod +>>> I think (hope) this can solve all the problems related to this feature request. +>>> +>>> From the url above: +>>> "With Template::Alloy you can use your favorite template interface and syntax +>>> and get features from each of the other major template systems." +>>> --[[Cstamas]]