Help needed restructuring my wiki

90 views
Skip to first unread message

Tristan

unread,
Jan 8, 2019, 12:46:26 PM1/8/19
to TiddlyWiki
Hey guys,

I was digging around lately and stumbled upon Trilium. Upon further reading about this I got pretty excited about its usecase and how similar many aspects are to TW. The author has done some nice writeup about his intentions and workflow in Trilium's wiki over on Github. Investing into some points I was quite surprised when I figured that its "cloning" mechanism is easily mimiced by TW using tags and having TW generate the Tree View on the fly. However I have some hickups so far as to how I generate the TOC. I tried using a list of all tags but that resulted in TW "shitting" every tiddler on screen without any hint as to what tag it was. After adding <<currentTiddler>> this got somewhat better however I would like for TW to just show all tags (to be precise: only tiddlers that are used as tags) as top entries and any tiddler tagged by them when I drill down, similar to how Trilium does it.

<div class="tc-table-of-contents">
    <
<currentTiddler>>
    <$list filter="[!tag[]]">
        <$macrocall $name="toc-selective-expandable" tag=<
<currentTiddler>> />
    </$list>
</div>

Result should be something like this:

> Foo
   
> Bar
       
> Baz # shows up in multiple hierarchies since tagged: Foo Bar Bag
   
> Bag
       
> Baz
> Bar
   
> Foo
       
> Baz
   
> Bag
       
> Baz
> Bag
   
> Foo
       
> Baz
   
> Bar
       
> Baz

Thanks for any help, cheers.
Tristan

Mark S.

unread,
Jan 8, 2019, 1:15:23 PM1/8/19
to TiddlyWiki
If Foo, Bar, and Bag are all tagged as "root", then wouldn't tag="root" work?

Good luck
-- Mark

Tristan

unread,
Jan 8, 2019, 1:23:01 PM1/8/19
to TiddlyWiki
Yes I had this idea as well but then I would have to manually curate the list by tagging every tiddler with root. This layout would be quite static for the most part and force me to revisit every "root node" to check if it is still used as a tag.

What I want is somewhat more advanced as I want all Tiddlers that are used as tags to be at root level. This way TW would take care of the whole layout and not show Tiddlers that are not tags in other tiddlers. For reference I want a behaviour close to how Tagsistant does it.

It is somewhat hard to explain as I am no native but the basic flow would be:
  1. Go through all tiddlers
  2. Check if tiddler x is a tag in any other tiddler
  3. If yes, use it as a root node
  4. If no skip it
  5. Procede recursively (while I click on the expand arrow)
I hope this clarifies things a little bit, thanks for your suggestion.

Cheers,
Tristan

Tristan

unread,
Jan 8, 2019, 1:25:42 PM1/8/19
to TiddlyWiki
P.S. My code from above does that in some way but lacks the "expandable" feature for root nodes. Plus it skips tiddlers that are used as tags but have a tags themselves.


On Tuesday, January 8, 2019 at 7:15:23 PM UTC+1, Mark S. wrote:

Mark S.

unread,
Jan 8, 2019, 2:48:40 PM1/8/19
to TiddlyWiki
How about a button that, when pushed, would find all tiddlers used as tags and mark them with "root" ? Although you would have to update from time to time, by pushing the button, it wouldn't be too arduous. 

-- Mark

Tristan

unread,
Jan 8, 2019, 3:19:36 PM1/8/19
to TiddlyWiki
Hm... reading your answer I was struck by an idea. Would it be possible to hook into the "save" event when I hit the save button on my wiki? That would be nice as I have autosave disabled and therefore click that button quite often.

Cheers,
Tristan

Reply all
Reply to author
Forward
0 new messages