How to use the same tag with different meanings based on other tags?

132 views
Skip to first unread message

bimlas

unread,
Aug 11, 2018, 5:17:46 PM8/11/18
to TiddlyWiki
For example in my developer knowledge base I would like to use the `String` tag for my note about string related functions, but it has different meanings:
  • Python
    • String
      • Print Python string [tags: Python, String]
      • Integer from string [tags: Python, String]
      • ...
  • Ruby
    • String
      • Uppercase [Ruby, String]
      • Lowercase [Ruby, String]
      • ...
Is it possible arrange the table of contents based on all tags?

I apologize for the misty formulation, I'm not as good at English as I should to be.

Jed Carty

unread,
Aug 11, 2018, 5:35:12 PM8/11/18
to TiddlyWiki
I made something that may be what you are looking for but I have't used it in a long time. https://ooktech.com/jed/ExampleWikis/OtherMindMap/

Mat

unread,
Aug 11, 2018, 6:38:48 PM8/11/18
to TiddlyWiki
Possibly Tobias' xlist

<:-) 

Mark S.

unread,
Aug 11, 2018, 7:22:35 PM8/11/18
to TiddlyWiki
You can create tags like Python-String and Ruby-String, and then use the caption field to just contain "String". The TOC macros will use the caption field if available.

-- Mark

Sjaak Adriaanse

unread,
Aug 12, 2018, 5:59:14 AM8/12/18
to tiddl...@googlegroups.com
Aha, this can probably help me in creating subject tags vs. generic tags (https://groups.google.com/forum/#!msg/tiddlywiki/FkpTfAFlZC0/6_3a6D4QBgAJ;context-place=topic/tiddlywiki/qgSSprU3-f8).
Thanks Mark!

bimlas

unread,
Aug 12, 2018, 6:01:49 PM8/12/18
to TiddlyWiki
Just realized that it's simply impossible to use the same "epxression" (tag) to describe different things.

My basic idea is to use the "Python" and "Ruby" tags as contexts for "String": String has different meaning for Ruby and another for Python. I like to handle tags as sets (like in math). For example take a look at https://i.imgur.com/VI2lr4s.png - Ruby/String is not the same as Python/String, regardless that both is related to the same expression (String). I hope you've got the idea. An implementation of this in Boostnote: https://github.com/BoostIO/Boostnote/pull/1775#issuecomment-380344905

Mark: I don't think that this is a good idea. The table of contents is OK but the usage of tags (as shown on the top of the tiddlers) is inconsistent: I see in ToC that I'm using the String tag, thus I would like to apply to a new note, but this note is not shown anywhere in the ToC - I had to use "Ruby-String" exactly.

The closest solution is possibly http://tagfilter.tiddlyspot.com/ but it's not exactly what I like to do.

TonyM

unread,
Aug 12, 2018, 8:22:30 PM8/12/18
to TiddlyWiki
Bimlas,

I am not 100% clear on what you detailed issue is here however I have to disagree with 


Just realized that it's simply impossible to use the same "epxression" (tag) to describe different things.

I believe you can use tiddlywiki tags, tiddlers and fields to represent any relationship in the universe, yes I am that bold to make that claim, and I am happy for someone to present cases they think I cant and prove, and demonstrate they are incorrect. However I think you may be trying to use the TOC macro incorrectly, and you need to make your own listing method.

If we look at https://imgur.com/VI2lr4s all you need is three tags string ruby and python
and if you test for ruby AND string you will get your ruby/string

Now if your use of "string" means the one on ruby is totally unrelated to the string you tag on python then divide it into two tags. In your case this does not seem required.

The thing is the TOC macros are helpful to have as they do a recursive process that drills down a hierarchy an indefinite number of levels. I believe every one should learn how to code something that is recursive and what it means, just as they should understand sequence, iteration and selection (yes I mean everyone). But why try and make a TOC process do something it is not customised for?, the ones in tiddlywiki are to list the tiddlers tagging a tiddlers children grand children all the way down, you are not asking for that here, you are asking for some logic within that.

Until I understand better lets look at a more complex test I have designed previously in TWC but see no issue doing it in TW5, it demonstrates how sophisticated you can get.
  • It is possible to look at all tags on a given tiddler, and for each of these tags test if they are in turn tagged by another tiddler
  • For Example lets say my 1st tiddler is tagged
    Working Projectname subtask
  • and for arguments sake we also have a tiddler called status which tags the tiddlers
    new working hold and finished
  • It is possible to test each of the tiddlers current tags "Working Projectname subtask" to see if any of them are tagged status (as working is)
Personally I have started using custom fields, their existence in a tiddler and when necessary their value in a tiddler for my organisational methods, leaving tags free for adhoc relationships and the default TOC use.

You can also test if a tiddler is NOT tagged something.

I think the http://tagfilter.tiddlyspot.com/ was proposed for TW5.1.7 and alternatives now exist in TW5.1.17 and sometime before.

Feel free to ask more questions, ideally keeping them simple, a step at a time. or provide a working example.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages