On 10-12-07 04:32 PM, Platonides wrote:
Daniel Friesen wrote:
On 10-12-07 08:18 AM, Bryan Tong Minh wrote:
I was first like wtf as well, but on the other hand this way skin building would be much more accesibles for non-programmer mediawiki users. Regular wiki users do know wikitext, as opposed to PHP. I'm not entirely sure though that this would be good for your sanity. I wouldn't discard the idea immediately, insane as it may seem.
^_^ I was drafting a response Platonides' comment, ie: an example of a chunk of MonoBook code using a WikiText style template language... in order to demonstrate the insanity of using the style that our preprocessor preprocesses as a template language for skins... I decided it sounded obviously insane enough that I didn't need to... ;) wan't me to re-start that example...?
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
I'm not sure myself of the sanity of such approach. :) But if {$title|escape:html} is considered "friendly", it'd be much better to use a known syntax than creating a new one.
;) that's Smarty, it "is" a known syntax. json-template would be {title|html-attr-value}, not much better.
By the way, I managed to create an absolutely horrid preg_replace_callback based syntax: <h3 id="siteSub">{msg:tagline}</h3> <div id="contentSub"{h:userlangattributes}>{h:subtitle}</div>{ifdata:undelete|x1x| <div id="contentSub2">{h:undelete}</div>|x1x} <!-- start content --> {h:bodytext} {h:catlinks} <!-- end content --> <ul> {foreachdata:content_actions:tab|x1x| <li{ifdata:tab.class|x2x| class="{t:tab.class}"|x2x}><a href="{t:tab.href}">{t:tab.text}</a></li> |x1x} </ul>
It works...! I'm just waiting on finishing up my abstraction of the sidebar to finish up a port of MonoBook to it. And the code that handles the syntax is even less than 100 lines. The idea is that whatever known or unknown syntax we come up with, we can compile it to this syntax and not have to re-parse the template source each time, and not have to deal with compiling to php which could have php injection vulnerabilities.
Now, as for a "known" or unknown syntax, what's the friendliest syntax for outputting variables with and without html escaping you can think of?
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]