[TWX] syntax for supertransclusion and filter evaluation

76 views
Skip to first unread message

Mat

unread,
Sep 29, 2018, 5:33:25 AM9/29/18
to TiddlyWikiDev
For TWX (a potential, fantastical, future version of TW) I'm proposing some minor syntactical changes - assuming the overall TW syntax paradigm is at all still relevant then;

{{{ ... }}} - instead of current filter evaluation, it is used to "transclude the transclusion". There are occasions where {{foo}} gives "bar" but what is needed is {{bar}}, so this super transclusion would do this. Thus, the swirly brackets are dedicated to transclusion matters.


[[[ ... ]]]  - this, instead, is for "filter evaluation". Thus, square brackets are dedicated to filter matters.


<:-)

joearms

unread,
Oct 1, 2018, 11:56:47 AM10/1/18
to TiddlyWikiDev
It would be nice to add one more layer of indirection if necessary -- here are some examples

    {{foo.jpg}}     -- transclude an image
    {{foo.jpg | width:100, height:35}  -- translude a image with size
    {{TiddlerLink}} -- transclude a tiddler
    {{my_local_file.txt | type:text, start:200, stop:400}} transclude a local file from lines 200 to 400

The syntax {{File | arg1:..., arg2:...}} means translude File with some arguments, and the meaning would depend
upon the file type. As the number of arguments become large it becomes very difficult to add them 'in line' - so
we add a layer of indirection

     {{MyTiddler.tr}} this means the translusion instructions will be found in the Tiddler MyTiddler.tr -- these could be
very long and complicated (for example contain SQL queries, entire scripts in some programming language etc.)

As an experiment I'm writing a pure stand-alone  transcluder that only expands {{...}} items.

It came as a nasty surprise to me that {{http://some_thing.html}} didn't do what I expected :-)

There's actually a very long philosophical discussion to be had about the scope of transclusions - Jeremy's design
for the tiddly wiki was to strictly adhere to what I call 'all in one' ness - ie all the tiddlers you can refer to must be
in the same physical and logical container - this is great for many purposes since it ensures the TW will still be the same
in many years time BUT ... I find myself wanting to break outside the container.

[http://....]] does allow a breakout - when you click it. 

{{http://....}} could mean - "go and transcribe the contents of the reference and cache the contents" but for how long - would remote transclusions have a time to live? It would be very nice to transclude tiddlers from somebody else's TW - but how would this work? Should a TW have a public interface (ie certain tiddlers are tagged as public) and may be remotely transcluded. 

TonyM

unread,
Oct 1, 2018, 8:12:11 PM10/1/18
to TiddlyWikiDev
The thing I would like to "transclude" the most is filters

So I may gave a complex or long filter to identify active tasks that are not closed, cancelled or archived and in a particular context current domain, project/client then transclude them

In a filter "[{active-tasks}{this-context}]

Something like this can already be done but I do not want the filters active-tasks appearing as regular tiddlers and in search results

I could use {$:/filter/this-context} however it quickly starts to loose its readability.

Perhaps a "name space" $:/transcludes such that $:/transcludes/this-context can be transcluded as {this-context} 

or even smarter

Perhaps a "name space" $:/transclude/filters such that $:/$:/transclude/filters/in-context creates a filter operator

"incontext[]" that can be negated "!incontext[]" and perhaps we can use suffix and content in some way

This would make it much easier to share filters, keep macros a lot clearer and help new users learn from existing ones.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages