Hi Stobot

> I don't know if anyone else builds things like I do - with a ton of dynamic 
> tables and branched lookups, but I use this pattern all the time:
> 
> \define macrotobuildfilter() ...
> 
> <$wikify name="macrotobuildfilterwiki" text=<<macrotobuildfilter>>>
> <table>
> <$list filter=<<macrotobuildfilterwiki>>>
> ...
> </$list>
> </table>
> </$wikfiy>
> 
> That's just with one, but usually I have a few nested ones. In fact I'll go 
> so far as to say that more than half of the time I use a macro, I have to 
> wikify it before use as it's being used as a parameter for something else.

The pattern you’re using here is a subtle one: to use the wikification process 
to create filter strings. As you’ve probably gathered, it can be quite brittle. 
For example, there can be problems if titles included in your filter strings 
include wikitext markup (e.g. HTTP links contain an embedded //). One tip is to 
prepend the \rules pragma to the start of the text to be wikified and thus 
restrict the wikitext rules that will be recognised.

> I've often thought of how great it would be to have that wikification done in 
> the same step - maybe with triple brackets like <<<wikified macro>>> ? 
> Similarities to the {{{...}}} notation in a way. 

Yes, it’s somewhat anomalous that there isn’t a quoted attribute syntax that 
returns the wikified value of the argument. Part of the reason is that as Mat 
points out, wikification is a relatively slow process (unlike wikifying the 
page we can’t do any selective refreshing, we have to process the entire text 
on each refresh cycle).

> Is this possible? I see some other threads on additional parser rules, so 
> thought it might be a good time to bring up. 

It might be worth experimenting with it, but I’d be concerned about performance.

An alternative approach that might be a bit easier would be to create a pragma 
that’s a shortcut for the wikify widget. Something like:

\define-with-wikification macrotobuildfilter() ...

<table>
<$list filter=<<macrotobuildfilterwiki>>>
...
</$list>
</table>

An ordinary \define pragma generates a single <$set> widget; this new pragma 
would generate a <$set> widget with a nested <$wikify> widget.

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/parsers/wikiparser/rules/macrodef.js
 
<https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/parsers/wikiparser/rules/macrodef.js>

Best wishes

Jeremy

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywiki+unsubscr...@googlegroups.com 
> <mailto:tiddlywiki+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/a0aff5bb-2aa3-4bc0-8094-72cf07c550a8%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/a0aff5bb-2aa3-4bc0-8094-72cf07c550a8%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7ED54FDB-6C11-4379-A808-AC6CC432110F%40gmail.com.

Reply via email to