Wikify and urlencode

60 views
Skip to first unread message

TonyM

unread,
Jun 19, 2018, 7:03:05 PM6/19/18
to TiddlyWiki
Folks,

I am working on a generic mailto macro link builder and have come across the following problem, while trying to ensure emails can be composed from existing text and tiddler content.

  • I can use <$view field=email-body format=htmlwikified/>> to wikify a field before urlencoding
  • I can use <$view field=email-body  format=urlencoded/> to urlencode a field
But I cant see how to feed the result of the first step into the second step so the result is both Wikified and urlencoded.

  • I want to avoid a button or other trigger widget (to gain access to an action widget to store the intermediate result)
  • The View widget only seems to accept a field name (default text) as input to I cant reference the intermediate result.
Any help would be appreciated

Regards
Tony

Mark S.

unread,
Jun 19, 2018, 8:27:38 PM6/19/18
to TiddlyWiki
This may or may not get you to where you want. Since <$view> requires a field, you can only use it once. So I put it into macro, had the wikify widget evaluate it, and then use that as input into the encodeuri operator.

\define wikme() <$view tiddler="TestTiddler" format="htmlwikified"/>

<$wikify name="wikid" text=<<wikme>>>
<$list filter="[<wikid>encodeuri[]]"/>
</$wikify>

Probably all of this would be wrapped in a second or 3rd macro.

Have fun!
-- Mark

TonyM

unread,
Jun 19, 2018, 9:53:10 PM6/19/18
to TiddlyWiki
Mark,

Thanks, I did not realise there was filter operators for encoding/de coding. So now I can do the second encoding step with a reference to a variable (populated by the wikified macro call).

It is so obvious "NOT", so thanks for your insight.

tony

Mark S.

unread,
Jun 19, 2018, 10:57:57 PM6/19/18
to TiddlyWiki
Yeah, it kind of slipped in there. I only learned about it a couple weeks ago in this forum.

It really pays to spend quality time with those release notes ...

TonyM

unread,
Jun 19, 2018, 11:20:08 PM6/19/18
to TiddlyWiki
Agree,

But Quality time is not enough always at tiddlywiki.com in some cases. I am currently learning to interogate json datatiddlers, and It seem so difficult with imperfect documentation. For example I want to select tiddlers to open from the HistoryList which is given as an example of using data tiddlers, but there seems insufficent info to learn how to list the tiddlers named in the history list.

Drives me crazy,

But thanks for catching this one.

Tony

Mark S.

unread,
Jun 19, 2018, 11:41:19 PM6/19/18
to TiddlyWiki
I think that when the documentation says that the HistoryList  is a good example of json tiddlers ... it lies. Obviously there is some code inside of TW that can make use of the HL, but the actual example of JSON code that can be read by ## syntax is completely different than the code in the HL.

The given syntax is also limited, because you can't go deeper than level 1. So no car.make.model.year kind of data structures. If I'm wrong, it would be interesting to see how it's done.

-- Mark
Reply all
Reply to author
Forward
0 new messages