(Use case: I'm making a plugin that reads URLs from slice values.
Normally, it would be a standard HTTP URL, but if it's a long data:
URI, the user might prefer to dump the full data: URI in a separate
tiddler. But if there's no standard way to do it, I'll probably
provide a helper macro for the job, which would be trivial to
implement, but non-standard.)
The tiddler macro doesn't support this at the moment. A wrapper is
required is to ensure the content is updated when the transcluded
tiddler is modified (see config.macros.tiddler.handler for details).
> Use case: I'm making a plugin that reads URLs from slice values.
> Normally, it would be a standard HTTP URL, but if it's a long data:
> URI, the user might prefer to dump the full data: URI in a separate
> tiddler.
It sounds like you are retrieving data from the DOM instead of from the
tiddler object. Is there a particular reason for that?
If you used the built-in TiddlyWiki.prototype.getTiddlerText method,
you'd get support for ::slices and ##sections notation for free.
-- F.
For the record, I'll explain it again in more detail. I've developed
an <<infoBox>> macro to show mediawiki-like info boxes. The tiddlywiki
author writes:
<<infoBox type:warning>>
and the macro then looks up a tiddler called "warningInfoBox", which
contains some slices:
|message|Please follow these instructions carefully.|
|icon|http://example.com/warning.png|
The above model is simple, but in some cases, the user might want:
|icon|data:blahblahblahgarbagegarbage....|
which works just as well (in modern browsers), but the warningInfoBox
tiddler containing these slices becomes unwieldy. An alternative would
ideally be:
|icon|<<tiddler stopIcon>>|
with "stopIcon" tiddler populated with the whole data URI string,
nicely isolating it away, and in a way that's very intuitive for any
user familiar with <<tiddler>>. To allow for this indirection, my code
would simply run wikifyStatic() on the slice value.
However, the indirection fails because of the <span> wrapper. It's not
a big deal. I suppose one solution would be a boolean "raw" parameter
for the tiddler macro, but then again asking the user to use
"raw:true" is defeating the purpose of simplicity anyway.