On Mittwoch, 26. September 2007, cnit wrote: > > Finally, we were rightly asked to provide a parser function for <ask> > > (something like {{#ask|...}}). This would yield full template > > compatibility. The new "::" syntax is one step towards this, the better > > datavalue formatting is another one. What is really missing is the > > conversion of HTML-query outputs to wiki text. We still consider whether > > this is realistic for SMW 1.0 ... I will discuss this on the devel list. > > Mediawiki is strange thing - why in the world they are using different > type of outputs for parser functions and for parser tags? > Unfortunately, these things are preserved for better compatibility, > and won't be fixed. > > Though I don't know why can't MW crew introduce a feature to parser's > setHook method: > instead of > function setHook( $tag, $callback ) > > function setHook( $tag, $callback, $expandTemplates = false ) > > so, the extension like SMW can register with something like: > $wgParser->setHook( "ask", cbfn, true ) > > no incompatibility will be introduced in such case (because third > parameter is optional).
I am sure they will consider a patch that implements this, if anyone submits it. ;-) > > About conversion of HTML-query output into the wiki text, is it really > necessary? I've thought that ask results are lists of the pagenames > (Titles) and values of propeties? Then, these are unlikely have to > contain HTML tags or wiki-tags, they should be plain UTF8 texts with > no special purpose characters, am I wrong? The ask result itself, as provided by the SMW-store, is an multidimensional array that has objects for all values that will get printed (basically the structure is like that of ask result tables, just not as HTML but as objects). But to bring results to a page, they must be serialised in HTML or Wikitext. The output of the result printers achieves that, and it is true that most of this output is compatible with both HTML and Wikitext (e.g. you can have HTML tables in both). The problems arise with links, since linked titles do not work the same way in HTML and Wikitext. But basically this can be solved by copying the HTML-code and replacing some innermost function calls that currently make HTML-outputs instead of wikitext. > > Or, that's because of fansy HTML tables formatting ("table" attribute > of ask query)? Then, maybe it's better to limit functionality of > {{#ask|...}} to plain lists and template output? Or, just a one base > output class and extend with two different methods - one for <ask>, > another for {{#ask}}.. As I said, it is not the fancy formatting but the very result list. Not a big deal to change this, I think. We just need to extend the infrastructure slightly, so that appropriate functions are triggered for the printers. One then can implement those step by step. I guess chances are good that {{#ask }} would replace <ask> in the long run anyway, so the added effort would go away. There are some other discussion points for {{#ask}}, which I raise in a separate mail. Markus > Dmitriy -- Markus Krötzsch Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe phone +49 (0)721 608 7362 fax +49 (0)721 608 5998 [EMAIL PROTECTED] www http://korrekt.org
pgpdYpJTVTjNs.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel