Felicia
Thanks for considering this issue. Perhaps we should start a new thread,
since this is related but off topic.
Some more thoughts
- Felicia to be a true "local" variable it would more often be used in a
single tiddler so you need not worry about its display elsewhere, however
there is I believe mechanisms to refresh the tiddlers and their
transclusions in the story.
- Since this would be quite different behaviour we should perhaps use
an alternate defacto naming standard eg _varname or
<<localvar "varname" "filter">>
- Where filter can compute the next result?
- [<vaname>add[1]] to increment the value
- 33 to set the value...
- There is no need to save the value permanently, a separate step can be
taken to do this if needed.
- For example add an additional action to the save button to save
named variables into a field and restore them on load with start up
actions.
- A simple way to reload a tiddler is to navigate to itself, however
this needs a trigger.
- However my thought was the initial load of the tiddler was where
the rendering takes place and the variable "increments" during the render
leaving its transitory values in the rendered output (if displayed) or
affecting the conditional flow.
- Then once this is finished we can display the final value if needed.
In closing
- This "problem" may face some difficulties in the way tiddlywiki
operates
- From a users designer view point it is however in my view an important
gap to fill
- I can name dozens of cases where this would help.
- The key difference with such a variable is its use need not be inside
an open and close, just to set its value.
- Perhaps it has to be a widget.
Regards
TW Tones
On Friday, July 31, 2020 at 6:44:08 AM UTC+10, Felicia Crow wrote:
>
> Hi Tony,
>
> after some testing I may have a first idea, but there are two things:
>
> - Calls: Javascript macros are called when the tiddler is parsed. So
> you would need something that rerenders the tiddler - for instance the
> list
> widget you mentioned upon changes in the filter result - to call the macro
> multiple times without closing and reopening the tiddler. As an example if
> you change your variable in one tiddler and in another already open
> tiddler
> get the variable's value it won't be updated until the tiddler is
> reloaded.
> I currently don't have an idea for that.
> - Permanent Save: Due to javascript macros not being able to directly
> write to a field by themselves currently the variables only last as long
> as
> the wiki is not closed or reloaded. For this I might have a solution, but
> will need to play around a little more with it, before being able to say
> if
> it actually works or not.
>
> Regards,
> Felicia
>
> On Thursday, 30 July 2020 at 02:43:12 UTC+2 TW Tones wrote:
>
>> Felicia,
>>
>> Since you a quite able to build Javascript solutions into Tiddlywiki now,
>> I would like to ask a quick question, if it makes sense to you.
>>
>> Would you know how to define a global variable(s) that we can update
>> (repeatedly) via a macro call? As a result it will need to have a step to
>> initialise it.
>>
>> Imagine that inside a list widget someone could conditionally change the
>> variable, ie add 1 to a number or set a flag = yes, such that the value can
>> be accessed outside of the list widget?
>>
>> This is a missing mechanism as far as I can see.
>>
>> Regared
>> TW Tones
>>
>>
>>
>>
>> On Friday, July 24, 2020 at 8:34:52 PM UTC+10, Felicia Crow wrote:
>>>
>>> Hi,
>>> so after playing around with filter operators and trying to find a way
>>> over a data tiddler I wrote a javascript macro I attatched below.
>>> The only caveat with this is that you have to close and reopen the
>>> tiddler calling the macro due to how javascript macros are called. Maybe
>>> someone has an idea for how to reload a single tiddler.
>>>
>>> For now the macro - called simply with <<missing-tiddlers>> - renders as
>>> a list of all missing tiddlers sorted by how often they are referenced:
>>>
>>> [image: missingTiddlersList.png]
>>> It can be changed to render as a table by changing this line of code in
>>> the macro:
>>> return renderList(tiddlerData);
>>>
>>> To this:
>>> return renderTable(tiddlerData);
>>>
>>> Which then looks like this:
>>>
>>> [image: missingTiddlersTable.png]
>>>
>>> Please be aware that after importing the macro/changing it you have to
>>> reload your wiki for it to take effect.
>>>
>>> Also as an aside unlike Tony's solution this uses the backlink filter
>>> operator so it only counts hard links and excludes system tiddlers
>>> completely. A little more about what hard and soft links are here
>>> <https://tiddlywiki.com/#Hard%20and%20Soft%20Links>.
>>> The reason I did this is mostly to ensure that these are actual
>>> references and not just the tiddler title being in the text even if it
>>> isn't meant as an actual reference.
>>> Should you want to use Tony's solution with search instead of backlinks
>>> it is easy change the filter either by yourself or I can update the macro.
>>>
>>> Regards,
>>> Felicia
>>>
>>> On Thursday, 23 July 2020 23:05:56 UTC+2, Beckstrom wrote:
>>>>
>>>> Is there a way to generate a list of missing tiddlers sorted by the
>>>> number of times they have been referenced?
>>>>
>>>> Right now I have a hundred or so "missing tiddlers," and I'd guess most
>>>> of them are only referenced from other tiddlers once or twice - but there
>>>> are probably a handful that are referenced many times. I like to
>>>> periodically clean up and add things to my wiki, and knowing which
>>>> tiddlers
>>>> are most needed would be cool.
>>>>
>>>> thanks in advance!
>>>>
>>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/87f34d9f-844b-436b-8786-f8af564ac773o%40googlegroups.com.