Reveal widget with nonempty field

807 views
Skip to first unread message

Diego Mesa

unread,
Oct 13, 2017, 6:07:35 PM10/13/17
to TiddlyWiki

Hello all,

I am using the excellent alink macro from Tobias Beer: https://tobibeer.github.io/tb5/#alink

I use it to give people nicknames. For example I have a tiddler called: `My Full Name` I give that tiddler a field called `alink` with the value `nickName`. Elsewhere I can then say: `<<a: nickName>>` to link to this tiddler.

Now, I want to include a footer to tiddlers that says:

`''Note:'' This tiddler is aliased to: ____`.

I was following this post: https://groups.google.com/forum/#!msg/tiddlywiki/Q5OJ2KllSUw/g5NNO2B9CgAJ

to have a custom footer. I created a new Tiddler called `TiddlerFooter` and tagged it with: `$:/tags/ViewTemplate`. I then tried to use the reveal widget as:

```
<$reveal type="match" state="!!jeremy" text="tiddlywiki">
~TiddlyWiki!
</$reveal>
```

This works fine. But now I want to show my text only if the field `alink` exists and is non-empty (filled with anything). How can I accomplis that? I tried the following:

```
<$reveal type="match" state="!!alink">
~TiddlyWiki!
</$reveal>
```

but that did not work. Also, I am wondering if its possible with in the reveal widget, to then parse the text of that field, splitting by the `|` character, and display a list of comma separated values. For example, if the tiddler has the field: `alink: |nick1|nick2|nick3|`, I would like to show on that Tiddler a footer that says:

"Note": This tiddler has the following aliases: nick1, nick2, nick3

Thank you!
Diego


Diego Mesa

unread,
Oct 16, 2017, 12:34:00 PM10/16/17
to TiddlyWiki
Just a bump!

Mark S.

unread,
Oct 16, 2017, 1:02:00 PM10/16/17
to TiddlyWiki
You might use a <$list> widget to display/not display rather than a widget.

In the next release there might be a tool that can split on pipes using regular expressions. AFAIK, there is no native filter that can do that now.

Instead, consider having a co-field that's formatted as a list field. Then if you have field blink: peter paul mary, your code might look like:

<$list filter="[has[alink]]">
~TiddlyWiki!
<br/>
Has aliases: <$list filter="[list[!!blink]]"><$view field=title/>, </$list>
</$list>Enter code here...

Good luck,
Mark

Diego Mesa

unread,
Oct 16, 2017, 1:08:32 PM10/16/17
to TiddlyWiki
Thanks for the reply Mark. 

Wouldnt that just create a list of all tiddlers that have `alink` field? I just want to display the current tiddlers `alink` field as its footer - if it has one. 

Mark S.

unread,
Oct 16, 2017, 1:23:37 PM10/16/17
to TiddlyWiki
Oops. Change that first filter to "[all[current]has[alink]]".

Diego Mesa

unread,
Oct 16, 2017, 2:22:38 PM10/16/17
to TiddlyWiki
Hello,

I now have the following:

<$list filter="[all[current]has[alink]]">
<hr>
''Note'': This tiddler has the following aliases: <$list filter="[list[!!alink]split[|]]"><$view field=title/></$list>
</$list>

and it works fine, however, if the field of `alink` is |alias1|alias2|, I cant figure out how to properly separate by comma. I always end up with an extra comma at the end, using tobia's split plugin.

Also, ideally I'd like to parse that list and display: `<<a: alias1>>, <<a: alias2>>, etc.


Jed Carty

unread,
Oct 16, 2017, 2:36:46 PM10/16/17
to TiddlyWiki
why are you using both list and split? Wouldn't using just list work?

Diego Mesa

unread,
Oct 16, 2017, 3:11:42 PM10/16/17
to TiddlyWiki
Im sorry - Im not sure

Diego Mesa

unread,
Oct 16, 2017, 3:37:56 PM10/16/17
to TiddlyWiki
Its not clear to me how to get rid of the "|" without it. Also, I've updated split to append a comma as: 

<$list filter="[all[current]has[alink]]">
<br/>
<hr>
''Note'': This tiddler has the following aliases: <$list filter="[list[!!alink]split:\,\+[|]]"><$view field=title/></$list> 
</$list>

but now I get: Note: This tiddler has the following aliases: temp1,temp2,

Note the trailing (extra) comma. 

Jed Carty

unread,
Oct 16, 2017, 4:42:00 PM10/16/17
to TiddlyWiki
If you use the field as a normal list field than you don't need to worry about adding the | to it, and you can just use the normal listops filters to build the fields.

Diego Mesa

unread,
Oct 16, 2017, 5:08:01 PM10/16/17
to tiddl...@googlegroups.com
Hey Jared,

Sorry Im not understanding what you mean.

On Mon, Oct 16, 2017 at 3:42 PM, Jed Carty <inmy...@gmail.com> wrote:
If you use the field as a normal list field than you don't need to worry about adding the | to it, and you can just use the normal listops filters to build the fields.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/YOj4pgiykBQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5d58da28-a6d6-4949-a2ad-3d09c1c47e34%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jed Carty

unread,
Oct 16, 2017, 5:25:35 PM10/16/17
to TiddlyWiki
Just make the field alink have the value

temp temp1 temp2


then make the footer

<$list filter="[all[current]has[alink]]">
<br/>
<hr>

''Note'': This tiddler has the following aliases: <$list filter="[list[!!alink]butlast[]]"><$view field=title/>, </$list><$list filter="[list[!!alink]]-[list[!!alink]butlast[]]"><$view field=title/></$list>
</$list>

The second list is because you want the commas, but in this case the split plugin doesn't add anything.

Diego Mesa

unread,
Oct 16, 2017, 5:29:33 PM10/16/17
to TiddlyWiki
Jed,

The contents of the alink field is specified by the alink plugin I am using by Tobias Beer:


wouldn't that be incompatible with this plugin?

Mark S.

unread,
Oct 16, 2017, 7:26:57 PM10/16/17
to TiddlyWiki
If you overwrite the a: macro with this:

\define a:(target)
<$list filter="[has[alink]!has[draft.of]]"><$list filter="[enlist{!!alink}regexp[^$target$$]]" variable="dummy"><$link><<dummy>></$link></$list></$list>
\end

Then I think you could substitute lists for Tobias' piped text. It may not be as efficient, so be sure to test it a bit. (Requires 5.1.14 TW).

What's really needed is an "inlist[myalias]" filter operator. I'm surprised there isn't one.

Good luck,
Mark

PMario

unread,
Oct 17, 2017, 4:41:02 AM10/17/17
to TiddlyWiki
On Tuesday, October 17, 2017 at 1:26:57 AM UTC+2, Mark S. wrote:
What's really needed is an "inlist[myalias]" filter operator. I'm surprised there isn't one.

IMO no need for an "inlist" operator. Eg:

<<list-links filter:"a b wiki testWiki +[regexp[(?i)wiki]]">>

is much more flexible.
 
have fun!
mario

Mark S.

unread,
Oct 17, 2017, 9:21:20 AM10/17/17
to TiddlyWiki
That's almost OK if all you want is to return a text string. But what I want is to find those tiddlers whose list field contains a value. If you noticed, I did use regexp, but I had to do it in 2 nested lists. And I had to pop out the list values before applying regexp.

If compared to SQl, which attempts to read like english the resulting code is rather opaque. Readability should be a goal as well raw functionality.

Mark

PMario

unread,
Oct 17, 2017, 10:10:25 AM10/17/17
to tiddl...@googlegroups.com
On Monday, October 16, 2017 at 11:29:33 PM UTC+2, Diego Mesa wrote:
The contents of the alink field is specified by the alink plugin I am using by Tobias Beer:


wouldn't that be incompatible with this plugin?

Yea, ... and that's the problem. ... alink uses a "list syntax", that doesn't fit to your usecase. So imo you use "a screw-driver for a nail". .. And the whole thread deals with symptoms, that come up, but imo doesn't fix the underlaying problem.

As far as I do understand your original post (OP) you want 2 functions:

 1) You want to use the alias names to create links, and
 2) you want to show a tiddler footer, that lists the available aliases.

So imo the easiest way to fix the problem is: "Use a hammer"!

------------

IMO function 2 would be solved, if your alink-field would look like a vanilla list field. ... Because Jed's suggestion would probably work. (I didn't test it!)

The advantage here would also be, that "enlist and all other listops" operators would work, with your list field too! ... Many filter operators haven't been there 2 years ago, when the alist-macro was designed!

-------------

Function 1) is a bit more complicated, but I think as Mark suggests, we should rewrite the macro, according to the OP or 1) and 2)

-mario




Diego Mesa

unread,
Oct 17, 2017, 4:41:48 PM10/17/17
to TiddlyWiki
Can anyone comment on if the above proposed rewrite to the alink macro is "efficient" or not? At least at a cursory glance? My wiki is small so testing shows no real difference.

Mark S.

unread,
Oct 17, 2017, 5:13:00 PM10/17/17
to TiddlyWiki
The efficiency would relate to how many tiddlers with alink fields you have. Because there's no native inlist operator, the macro has to look at all tiddlers with a filled alink. Possibly someone who was really good with regexp could come up with regexp that would work just like Tobia's version but not with pipes. But I kind of doubt it -- it would have to look for things enclosed in double square brackets AND things not in square brackets. Which I suppose is why Tobias used pipes.

Another possibility is to have the aliases as lists (perhaps field aliases), but run a button that would instantly create a alink field in all aliased tiddlers with the list formatted with pipes.  People seem to have objections to 2-step processes, but they do save a lot of headaches.

Mark

PMario

unread,
Oct 18, 2017, 3:35:26 AM10/18/17
to TiddlyWiki
On Tuesday, October 17, 2017 at 10:41:48 PM UTC+2, Diego Mesa wrote:
Can anyone comment on if the above proposed rewrite to the alink macro is "efficient" or not? At least at a cursory glance? My wiki is small so testing shows no real difference.

If we rewrite it, we can't use the same name. The same macro name will create confusion and problems in the future.

The second problem is, that the "references" tab in the tiddler info panel doesn't work witht the alias links.

-m

PMario

unread,
Oct 18, 2017, 8:17:11 AM10/18/17
to TiddlyWiki
Hi Diego,

The "aliasing" topic is pending for a long time already [1]. This thread initiated Tobis's alink macro.

Aliasing is also dicussed quite controversal in the core repository at github [2]. Also here in the group you can find several threads. ...

Jeremy has a very specific view, what an "alias" is. ... At thread [1], Jeremy mentions that the OP describes something that is planned for version 5.1.0 ... Sadly it was never implemented. ...

That may be one reason why Tobias named his macro <<alink>> and not <<alias>>. I did call my rewrite attached here <<aka>> .. for "also known as". IMO it has a meaning, is short and easy to type ;)

.. We still hope, that we can come up with something in the core that may be a real <<alias>> with maximum integration and features ....

In the mean time, we will have to wrok with plugins. :)

You can download the attached aka-macros.json file and drag and drop import it to your TW. !! BACKUP FIRST !!

It contains several tiddlers:

aka-footer ... footer template, that contains a refined version of Jed's footer code
aka-macros ... 3 macros ... refined, but based on Mark's code

alias-list ... tiddler linked list + all aliases

test-double-definition ... test tiddler
aka-test ... test tiddler
asdf ... test tiddler

Macros:

<<aka "target">> ... used instead of <<a:>>
<<aka "target with spaces">> 
<<showAliases>> ... used in the footer <<listAliases>> ... used in alias-list

Your tiddlers should use a field named aliases now, which looks like this:

aliases: nick1 nick2 [[nick with spaces]]

This mechanism uses a "space sparated list" now, that is more compatible with the TW5 core, has more possibilities, and imo should be more future proof.

Hope that helps.

-----------------

I did create an uni-link plugin [3], some time ago, which is able to deal with the "second problem" I did mention in the other post. ... It may be possible, that I can extend its functionality to deal with aliases, in a backwards compatible way, too. But I'm not sure yet!!!

... NO promises made :)

--------------

have fun!
mario

[1] https://groups.google.com/forum/#!searchin/tiddlywiki/alias%7Csort:date/tiddlywiki/YlKBBl1Jdww/TaFSK8UvFgAJ
[2] https://github.com/Jermolene/TiddlyWiki5/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20alias
[3] https://wikilabs.github.io/editions/uni-link/

aka-macros.json

PMario

unread,
Oct 18, 2017, 8:44:12 AM10/18/17
to TiddlyWiki
Hi folks,

I will refine and package the aka-macros bundle into a real plugin at wikilabs [1].

The goal is to integrate the "alias-list" into the tiddler info panel as eg: "Alias List" or so ..

---------------- slightly off toppic -------------

If the "uni-link" mechanism works out in the way I think, it should be possible, get some kind of "backlinks / references" list too. ...

For this to work we can use eg: [[nick1|]]  and give it a special handing in the uni-link parser. The good thing here is, that the default parser completely ignores the pipe "|" character in this construction. So the new handling should be partially backwards compatible.

I'd like to name this construction [[nick1|]] an alias link! ... I know that the pipe is not very visible but [[nick1|?]] is a valid pretty link already :/

If that's not possible I'll call it a flag or flagged-link similar to the flags in "mine-sweeper" ;)

The advantage of [[nick1|?]] would be, that it would link every alias to the "?" tiddler if you copy paste them to TWs, that don't understand the new syntax, instead of ignoring it.

@Jed @Mark and @other
what do you think?

have fun!
mario

[1] https://wikilabs.github.io

Mark S.

unread,
Oct 18, 2017, 10:00:06 AM10/18/17
to TiddlyWiki
What does the syntax "|?]]" do?

Is there any hope that any of this could end up in the core?


Mark

Diego Mesa

unread,
Oct 18, 2017, 10:59:41 AM10/18/17
to TiddlyWiki
Thank you mario and everyone else who has helped in this thread! I look forward to downloading the "official" macros plugin from you site.

PMario

unread,
Oct 18, 2017, 11:14:20 AM10/18/17
to TiddlyWiki
On Wednesday, October 18, 2017 at 4:00:06 PM UTC+2, Mark S. wrote:
What does the syntax "|?]]" do?

Is there any hope that any of this could end up in the core?

IMO |?] is much more visible but as I wrote it is already a valid pretty-link for existing TWs. Whereas the |] will be ignored.
Just compare [[test|?]] with [[test|]]

The standard way to get stuff like this ready for the core is plugins. ... If they are a success, we can discuss implementing them into the core. Especially in cases like this one, where no consensus is reached yet.

-m

Mark S.

unread,
Oct 18, 2017, 12:19:57 PM10/18/17
to TiddlyWiki
Oh, I see. You're just saying that someone might have a tiddler with the title "?" .

OK. So, if you combine alias with uni-links, someone might make a link [[alias|]] and see displayed [[sub-title]] ?

It's starting to feel like there needs to be some extra syntax for the user to indicate how they want the link to appear. Since users are warned to avoid |, { , } , and [ and ], I suppose there could be something like:

[[alias|{}]] display sub-title, caption, title
[[alias|] display title
[[link{}]] display sub-title, caption, title
[[link]] display  title

Probably someone could come up with better syntax. This way the behavior stays close to the original default. Of course, people could still perversely use |{}[], but that is already the case.


Mark

PMario

unread,
Oct 18, 2017, 1:45:25 PM10/18/17
to TiddlyWiki
On Wednesday, October 18, 2017 at 4:59:41 PM UTC+2, Diego Mesa wrote:
Thank you mario and everyone else who has helped in this thread! I look forward to downloading the "official" macros plugin from you site.

Just to be sure. Have you seen the downloadable attachment from my prior post?
IMO there is no need to wait for the final plugin.

-m

Diego Mesa

unread,
Oct 18, 2017, 1:51:16 PM10/18/17
to TiddlyWiki
Thanks Mario - I just wasn't sure if once bundled it would be more of a package which is easier to install and uninstall.  

PMario

unread,
Oct 18, 2017, 3:08:31 PM10/18/17
to TiddlyWiki
On Wednesday, October 18, 2017 at 7:51:16 PM UTC+2, Diego Mesa wrote:
Thanks Mario - I just wasn't sure if once bundled it would be more of a package which is easier to install and uninstall.  

At the moment it's easier to tweak, since all the files are visible. ... and you can easily delete the test-tiddlers.

You just need to keep:

aka-footer ... footer template, that contains a refined version of Jed's footer code
aka-macros ... 3 macros ... refined, but based on Mark's code
alias-list ... tiddler linked list + all aliases



Once it is a plugin, all the files will be shadow tiddlers, that are "kind of" hidden. And getting the docs and edition right will be more work then the functionality itself. ....
That's why there is no timeline.

-m

Diego Mesa

unread,
Oct 18, 2017, 3:39:32 PM10/18/17
to TiddlyWiki
Thanks for the reply and your continued hard work Mario! I went ahead and installed your macros and have been testing them out. Frequently I use things like:

<<aka Tom>>'s papers

which now renders as: Tom 's papers (Note the space between Tom and the ' character). Is this an easy edit? 

PMario

unread,
Oct 18, 2017, 4:40:07 PM10/18/17
to TiddlyWiki
Hi Diego,

See attachment and only import: aka-macros

-m
aka-macros-v2.json

Diego Mesa

unread,
Oct 18, 2017, 4:54:35 PM10/18/17
to TiddlyWiki
Thanks Mario! You're the best! 

PMario

unread,
Oct 19, 2017, 3:11:52 AM10/19/17
to TiddlyWiki
On Wednesday, October 18, 2017 at 10:54:35 PM UTC+2, Diego Mesa wrote:
Thanks Mario! You're the best! 

:)

Diego Mesa

unread,
Oct 20, 2017, 6:57:23 PM10/20/17
to TiddlyWiki
Hey Mario,

For some reason I cant explain, after uploading your new aka-macro I saw that it fixed my problem with

<<aka Tom>>'s papers

But now, it is still showing a space for

<<aka NN>>.

(The period). Even if I changet that period to something else it still shows up with a space. I went back and checked, and Tom is still rendered correctly, even if I change it to:

<<aka Tom>>. papers

so now I really am confused!

Best,
Diego

Mark S.

unread,
Oct 20, 2017, 7:41:20 PM10/20/17
to TiddlyWiki
Hello Diego,

You have us at a disadvantage. Can we see the tiddler aliased as NN ? My guess is that there is something unique in the alias list that is causing the space.

Mark

Diego Mesa

unread,
Oct 20, 2017, 8:36:33 PM10/20/17
to TiddlyWiki
Attached are two JSON files, one is the Neural Networks tiddler, the other is a testing tiddler showing the difference in how it renders Tom and NN
Testing Tiddler.json
Neural Networks.json

Mark S.

unread,
Oct 20, 2017, 8:43:56 PM10/20/17
to TiddlyWiki
Might need a screenshot of what you're seeing. There's no space after <<aka NN> in my test. But maybe that wasn't what you meant?


Mark

On Friday, October 20, 2017 at 3:57:23 PM UTC-7, Diego Mesa wrote:

Diego Mesa

unread,
Oct 20, 2017, 8:46:39 PM10/20/17
to TiddlyWiki
Attached is a screen shot of what I see
temp.png

Mark S.

unread,
Oct 20, 2017, 8:55:17 PM10/20/17
to TiddlyWiki
Hmm. Although I'm not seeing the problem in your data, it is showing up in aka-test. That makes it seem kind of random.  Might have to wait for PMario to take a look at it.

Mark S.

unread,
Oct 20, 2017, 8:59:34 PM10/20/17
to TiddlyWiki
Ok, this may fix it. You have to pack out all the space in the aka macro:

\define aka(target)
<$list filter="[has[aliases]!has[draft.of]]"><$list filter="[enlist{!!aliases}regexp[^$target$$]]" variable="dummy"><$link><<dummy>></$link></$list></$list>
\end

That should be 3 lines (in case it wraps strangely on your screen). It got rid of the space I was seeing. However, now if there is a double definition, the links are right next to each other without space.

Mark

Diego Mesa

unread,
Oct 20, 2017, 9:57:20 PM10/20/17
to TiddlyWiki
Hey Mark,

Thanks for the help - that fixed it for me! 

Its still a mystery to me why it was showing up with NN and not Tom, but they both seem to be ok now. Thanks again!

Diego

Diego Mesa

unread,
Oct 24, 2017, 4:28:25 PM10/24/17
to TiddlyWiki
Hey Mario,

I know you're working on putting this up on wikilabs, but I just have an observation that has come up by putting this to extensive use:

I frequently find myself defining aliases before creating a post. That is, I'll be in `Topic 1` and type `this is related to <<aka T2>>  by way of ...` before having created a new `Topic 2` tiddler with the appropriate `T2` alias. This shows up in the body of `Topic 1` as "missing". In other words, it renders as: `this is related to by way of ...`. This is typically not a problem for me because I then immediately go and make the appropriate tiddler which will automatically fix the rendering. However, sometimes I step away and it's not immediately obvious that there is a problem. I think it would be useful to have some kind of visual indication of a missing alias/aka. Perhaps rendering a red+bold link? Or perhaps just an italicized link as is typical in tiddly wiki? Perhaps this is user configurable? 

I don't mean this to come off as demanding more from you on this already excellent plugin. I just wanted to drop this here in case you think it would also be useful/easy. 

Thanks for everything.


On Thursday, October 19, 2017 at 2:11:52 AM UTC-5, PMario wrote:

PMario

unread,
Oct 25, 2017, 4:34:49 AM10/25/17
to TiddlyWiki
Hi Diego,

That's a valid point! ... The problem here is, that it's not easy to solve with wikitext alone. ...

The macro uses 2 nested lists. ...

 - The first list widget searches for all tiddlers that have an aliases field.
   - which returns a list of tiddlers.

 - The second inner list, checks the aliases field if the alias name matches.
   - There may be several alias names in the field
     - If the pattern matches, ... the alias will be shown
       - If the alias matches in several tiddlers, both tiddlers will be shown (that's needed to detect duplicates)
     - If the pattern doesn't match, ... nothing will be shown.

Now this "nothing will be shown" causes the problem. _But_ it is a valid option and we need it .. That's why we can't replace it with anything else.

So to solve the problem, we'll have to have a closer look. ...

There would be an option to create a javascript macro. I didn't consider it, until now, because I did like the relative simplicity and clear structure of the current implementation. But it clearly doesn't cover all the edge cases ....

I'll see, what I can do. .... _but_ don't expect it immediately.

have fun!
mario





Mark S.

unread,
Oct 25, 2017, 9:31:09 AM10/25/17
to TiddlyWiki
Couldn't the "emptyMessage" option be used to flag the missing alias?

Mark

PMario

unread,
Oct 25, 2017, 12:20:19 PM10/25/17
to TiddlyWiki
On Wednesday, October 25, 2017 at 3:31:09 PM UTC+2, Mark S. wrote:
Couldn't the "emptyMessage" option be used to flag the missing alias?

nope. ... As I wrote, we need if as a valid option. ... (I did test it already :)

-m
Message has been deleted

Mark S.

unread,
Oct 25, 2017, 12:40:18 PM10/25/17
to TiddlyWiki
Never mind. I see now ;-)

Mark

On Wednesday, October 25, 2017 at 9:38:06 AM UTC-7, Mark S. wrote:
Hi Mario,

I'm not sure what you mean by 'valid option'.

Mark S.

unread,
Oct 25, 2017, 12:48:31 PM10/25/17
to TiddlyWiki
If we had the hypothetical "inlist" macro, this would be easy.

Mark

Mark S.

unread,
Oct 25, 2017, 12:55:38 PM10/25/17
to TiddlyWiki
#2 Could also do it if there was a text 'equals' macro -- which I've submitted a PR for.

Mark

Diego Mesa

unread,
Nov 6, 2017, 6:40:50 PM11/6/17
to TiddlyWiki
Hey all,

I just wanted to provide a brief update here. As I have been trying to learn more about tiddlywiki, I have been studying PMario's aka macro bundle. I have made a "documentation" tiddler for this macro, with a "breakdown" where I tried to explain the macro line by line to the best of my ability right now, based on my current understanding. I also explained how I added searching the alias field to the search results of my wiki. 

Note: this tiddler wraps the breakdown in tobias' excellent appear widget: `<$appear>... </$appear>` If you don't have that installed, you can just remove that wrapper. 

Thanks again to everyone who helped me with this!
Aka Macro Documentation.json

Diego Mesa

unread,
Nov 28, 2017, 6:50:19 PM11/28/17
to TiddlyWiki
Hey Mario,

I've been using this plugin very successfully so far, so thank you again! 

I have found myself recently trying to tag a tiddler with the alias of an existing tiddler. I don't see an easy way to enable this - I'm just wondering if you've thought at all about this, or if it's even possible. 

Thanks,
Diego

PMario

unread,
Nov 29, 2017, 10:24:54 AM11/29/17
to tiddl...@googlegroups.com
On Wednesday, November 29, 2017 at 12:50:19 AM UTC+1, Diego Mesa wrote:
Hey Mario,
I've been using this plugin very successfully so far, so thank you again! 

Great, that it worked out for you!
 
I have found myself recently trying to tag a tiddler with the alias of an existing tiddler. I don't see an easy way to enable this - I'm just wondering if you've thought at all about this, or if it's even possible. 

I thought a little bit about this. ... And let's have a closer look at the 2 different usecases of an "alias"

1st usecase: Simplfy writing.

We did create the <<aka>> macro to simplify the usage of "tiddler links" in plain texts. As "Alberto Molina" expressed it in his initial post, that started the discussion:

... I would like the links: [[Darwinism]], [[darwinism]], NeoDarwinism, NaturalSelection, [[natural selection]], [[theory of evolution]] all refer to the same tiddler (or different twin tiddlers with the same content in view mode) without needing to specify: [[darwinism|Darwinism]], [[NaturalSelection|Darwinism]], [[theory of evolution|Darwinism]], etc.


2nd usecase: Aliases as Tags.

I think, as soon as this happens, an Alias should be converted to a "real Tiddler". It still can exist in the "aliases" field.

But the simplest new tiddler should be created like this:

title: aliasName

{{Alias real Name}}

This gives us the full range of new possibilities, without making it more difficult. eg:

"Alexander the Great" could be an alias to the tiddler "Alexander III of Macedon". While the later can contain the pure facts, the new "physical Alias" can now contain some more info about the epithet "the Great", that was given to him by others. ...


My conclusion at the moment is:

There should be a point, where an alias should be a real tiddler becasue this also gives us the full possibilities of tiddlers as tags. ....

and more :)

just some thoughts.
have fun!
mario

PS: Thanks for the reminder, that there is actually some work to do :)



Ste Wilson

unread,
Nov 29, 2017, 1:44:33 PM11/29/17
to TiddlyWiki
Wow! Unearthed buried treasures!
tiddlystuff.tiddlyspot.com has some really good stuff and the alias macro tobibeer.github.io/tb5/#alink by the good Me Beer is also something I'll be having a play with.

Thanks!

PMario

unread,
Nov 29, 2017, 4:33:52 PM11/29/17
to TiddlyWiki
Hi Ste,

I did create slightly modified macros, which are attached at this comment.  It's called the <<aka>>  macro, for "also known as"

The description and story behind "alias" macros can be found here.

have fun!
mario

Diego Mesa

unread,
Dec 5, 2017, 5:07:38 PM12/5/17
to TiddlyWiki
Hey all,

I was thinking recently about dealing with <<aka "tiddler">> for tiddlers that dont exist yet, and just wanted to mention here that $:/core/modules/wiki.js contains the definition for the `getMissingTitles` function which might be useful in the future.

PMario

unread,
Dec 5, 2017, 5:26:57 PM12/5/17
to TiddlyWiki
On Tuesday, December 5, 2017 at 11:07:38 PM UTC+1, Diego Mesa wrote:
I was thinking recently about dealing with <<aka "tiddler">> for tiddlers that dont exist yet,

That's interesting. ... You can't define the "aliases" field to thin air. ..... except the tiddler name is "thin air" :)
 
BTW: I'll be uploading a new version of the uni-link macro soon. It will support <<uni-links>> and the <<aka>> macro

[[test]] ... uni-link ... using "subtitle", "caption" or "title" field as link text.
[[test|]] ... aka ... will use "aliases" field to create the link and "test" as link text.

have fun!
mario


Diego Mesa

unread,
Dec 5, 2017, 5:35:40 PM12/5/17
to TiddlyWiki
Wow thats great!

Can you clarify what you mean by "You can't define the "aliases" field to thin air"? 

Thanks Mario!

PMario

unread,
Dec 5, 2017, 8:04:51 PM12/5/17
to TiddlyWiki
On Tuesday, December 5, 2017 at 11:35:40 PM UTC+1, Diego Mesa wrote:
Can you clarify what you mean by "You can't define the "aliases" field to thin air"? 

I meant, that you need a tiddler to define the "aliases" field. ... No tiddler, no definition. .

-m

PMario

unread,
Dec 5, 2017, 8:07:27 PM12/5/17
to TiddlyWiki
or do you mean that if youi use <<aka test>> and "test" tiddler doesn't exist, ther is no text?

-m

Diego Mesa

unread,
Dec 5, 2017, 8:12:05 PM12/5/17
to TiddlyWiki
Yes thats what I meant - something rendering when "test" tiddler doesnt exist yet

Diego Mesa

unread,
Dec 14, 2017, 6:24:14 PM12/14/17
to TiddlyWiki
Just wanted to make a reminder to others (and myself) that currently, when dealing with aliases with spaces you:
  • set a tiddlers aliases field to: [[A name with spaces]]
  • use an alias with spaces as: <<aka "A name with spaces">>

PMario

unread,
Dec 16, 2017, 1:16:50 PM12/16/17
to TiddlyWiki
Hi Folks,

I did just push the latest version of the uni-link plugin, which now also includes a new Alias syntax.

Aliases now have backlinks, and you can create links to non existing aliases!

There is a lot of new stuff added including a new Intro-Video.

V 0.2.0 ... 2017.12.15

  • added: [[alias|?]] link syntax
    • using aka-makros for tiddler alias handling
  • added: Alias backlinks
    • open the tiddler (i)nfo area: References
  • added filter operators:
  • added: Right-Sidebar: More tab: "Aliases"
    • Sorted by Alias
    • Sorted by Tiddler Title
  • added: uni-link $:/ControlPanel setting
  • added: different colors for title, caption, subtitle and alias links


Have fun!

mario

PS - If you like it: Support it :)

Reply all
Reply to author
Forward
0 new messages