Folks,
You may know almost anything can be found in tiddlywiki using a text reference eg; tiddlertitle!!fieldname one example is the current story list $:/StoryList!!list.
In this example we use <<tv-story-list>> and can construct it from a function [<tv-story-list>addsuffix[!!list]join[]].
So I now have a function/variable containing the text reference <<story.location>>.
This all makes real sense when using tiddlywiki that such text references are in effect a minimal absolute reference. Although a simple title (default text field), a fieldname and a fieldname in the current tiddler !!fieldname are less absolute.
- We may want a list of text references or
text reference=value pairs
If we read text reference the only examples are where the coder/designer enters a static literal that references such “addresses”. In reality however these are practically built programmatically, as I have done with the above <<story.location>>.
This discussion
I want to seek ideas and code patterns for making use of such absolute text references when stored in a variable. It seem to me having to split them back into tiddler title and fieldname to make use of them is the loss of an opportunity to make use of this eternal and concise way to reference a tiddlywiki resource, even when arrived at programaticaly.
- Keep in mind we have full support for text references using literals as documented at text reference
- Further I believe that we will find gaps in functionality when it comes to leveraging text references stored in variables that would point to small but powerful enhancements to TiddlyWiki.
- Keep in mind we want to get or set values at a given “text reference variable” including iterate and update lists at such a location.
- It may just be to include a small set of operators that can be given a text reference variable, although I expect adding some wikitext support would be useful.
- What if widgets and macros could be given a text reference directly rather than separate
title=tiddler titleandfield=fieldnameeven providing a value to a given text reference?
Perhaps the solution is a small set of custom operators a user can install to address the gaps I have highlighted above? Alternatively have I simply missed the code patterns available to do this? making it worthy of documentation!
Background
Here is a little code examples needing 5.4.0 works on TiddlyWiki.com
\function story.list() [list<tv-story-list>]
\function story.list2() [lookup<story.location>]
\function story.location() [<tv-story-list>addsuffix[!!list]]
\function get.reference(reference) [<reference>split[!!]first[]] =>title [<reference>split[!!]last[]] =>fieldname [<title>get<fieldname>]
* `((story.list))` ((story.list))
* `<<story.location>>` <<story.location>>
* `<<story.list2>>` <<story.list2>>
* `<$macrocall $name=get.reference reference=<<story.location>> />` <$macrocall $name=get.reference reference=<<story.location>> />
; `{{{ [get.reference<story.location>enlist-input[]] }}}`
{{{ [get.reference<story.location>enlist-input[]] }}}
Perhaps we should use the new Multi-value variables MVV’s?