Resolve variables from JS

71 views
Skip to first unread message

Mirko Richter

unread,
Sep 5, 2019, 3:39:42 PM9/5/19
to TiddlyWiki
Hi,

how can one "resolve" env-variables from inside JavaScript-Code, e.g. from JS-Macros or Widgets? Accessing them is easy like this: this.getVariable("currentTiddler"), but what if i'd like to resolve complexer env-variables then the lots of currentTiddler-Cases scattered all over the TW5-core code? Is there a kind of a resolver, that i can us programmatically from inside JS?

BTW: I'm aware, that i can "deliver" the values already resolved using the different {{}} or <<>> notations, when calling the macro/widget... just wanna know ;)

Thanks,
Mirko

TonyM

unread,
Sep 5, 2019, 8:36:16 PM9/5/19
to TiddlyWiki
Mirko,

This Post may be better suited to the Dev Forum, https://groups.google.com/forum/?hl=en#!forum/tiddlywikidev

Regards
Tony

PMario

unread,
Sep 6, 2019, 5:56:58 PM9/6/19
to TiddlyWiki
Hi,

Dumpvariables may be an option. ... BUT it only shows the variables, that are active at the position in the widget-tree, where it is. ... So you'll only see 1 currentTiddler

But you can inspect the code, to see how you can access the stuff.

-m

PMario

unread,
Sep 6, 2019, 6:02:20 PM9/6/19
to TiddlyWiki

Jeremy Ruston

unread,
Sep 7, 2019, 4:55:47 AM9/7/19
to tiddl...@googlegroups.com
Hi Mirko

how can one "resolve" env-variables from inside JavaScript-Code, e.g. from JS-Macros or Widgets? Accessing them is easy like this: this.getVariable("currentTiddler"), but what if i'd like to resolve complexer env-variables then the lots of currentTiddler-Cases scattered all over the TW5-core code? Is there a kind of a resolver, that i can us programmatically from inside JS?

In TiddlyWiki we say informally that raw wikitext is “wikified”, meaning that it is evaluated to yield the underlying HTML or raw text. Internally, wikification consists of a separate but intertwined parsing and rendering process. In many ways it’s the heart of TW5.

But it would be unusual for a widget or macro to perform wikification itself, it’s much more efficient (as you guessed) to pass raw text parameter/attributes.

Perhaps you could outline what you’re trying to accomplish?

Best wishes

Jeremy


BTW: I'm aware, that i can "deliver" the values already resolved using the different {{}} or <<>> notations, when calling the macro/widget... just wanna know ;)

Thanks,
Mirko

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a74bc87b-4f98-4f38-9a93-18abe9542c05%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages