kookma / TW-Commander

A tiddler toolkit for Tiddlywiki 5. Batch operations on bulk of tiddlers. Create, delete, add fields, tags, search and replace and inspect tiddlers.
https://kookma.github.io/TW-Commander/
49 stars 8 forks source link

Option to use a sub-branch of a toc as search criterion #26

Open xgadscu opened 2 years ago

xgadscu commented 2 years ago

I like to use Tiddlywiki for documenting several things. The topics are organized as sub-branches of a toc. Now I want to be able to export such sub-branches. Is it possible to introduce an option in TW-commander, which allows to gather all tiddlers of a sub-branch in order to export them?

Maybe it is already possible and I missed something.

Best Regards xgadscu

kookma commented 2 years ago

You can do with the current Commander. Just use appropriate filter? Do you know how many levels is deep your branch? If you give me a minimum example I can show how to do.

xgadscu commented 2 years ago

From the user's point of view, the usage should be as easy and comfortable as possible without clarifying in advance how many levels the branch has. That means: the root of the branch should be the only parameter. My idea was that you could use the algorithm you built in the Multi level TOC UI macro.

Regardless, I would be interested in a specification using filter. A branch usually has 3-4 levels.

In the following example I would like to get all Tiddlers within Child 2 including Child 2.

Parent (root)
    Child 1
        Grand Child 11
        Grand Child 12
            Grand Grand Child 121
            Grand Grand Child 122
            Grand Grand Child 123
        Grand Child 13
        Grand Child 14
    Child 2
        Grand Child 21
        Grand Child 22
            Grand Grand Child 221
                Grand Grand Child 221 1
                Grand Grand Child 221 2
                    Grand Grand Child 221 21
                    Grand Grand Child 221 22
                Grand Grand Child 221 3
            Grand Grand Child 222
        Grand Child 23
    Child 3
        Grand Child 31
        Grand Child 32
kookma commented 2 years ago

My idea was that you could use the algorithm you built in the Multi level TOC UI macro.

That is the right solution, it uses recursive macro, but adding it needs some programming. I add this to wish list! For short term, If you use TOC macro then you can create a button to do this for you.

I asked the number of level to write the filter,

[tag[Learning]] [tag[Learning]tagging[]] [tag[Learning]tagging[]tagging[]] 

The above filter returns all tiddlers tagged with Learning (root) and those tagged with its child, and those with grand childern. You can extend this to fourth level, etc ...

xgadscu commented 2 years ago

I think many other users would also like it if you would implement the wish.

The filter is not so comfortable, but it works for now. During testing I noticed that the referenced tiddlers (via wikilink, transclusion or as images) are missing for the export. The filter functionality is obviously very powerful. But unfortunately I haven't found a way to get the referenced tiddlers into the selection. Do you have an idea?

kookma commented 2 years ago

I would recommend to ask on https://talk.tiddlywiki.org/ That needs a more complex filters, and I don't think it could be used with Commander searchbox.

Note that, this is a general problem (question). What you asked here can be used with $:/AdvancedSearch in Tiddlywiki.

kookma commented 2 years ago

See https://github.com/kookma/TW-Commander/issues/28

xgadscu commented 2 years ago

Great. I'm looking forward to the implementation...

kookma commented 1 year ago

This feature is no possible using filters! See https://talk.tiddlywiki.org/t/filter-question-return-all-toc-tiddler-titles-as-a-plain-list/5752/10

Planned for next release. See #28