vrtmrz / obsidian-tagfolder

MIT License
221 stars 17 forks source link

[Q]: please, suggest tagging strategy! #49

Open VKondakoff opened 2 years ago

VKondakoff commented 2 years ago

Let's say I have several notes about fruits in general. There are combined using tag #fruits. Then there are some notes about apples (tag #apples) and oranges (#oranges).

This gives smth like this in the tagtree:

> apples
    - green apple
    - red apple
    ...
> fruits
    - note about fruits
    - bananas
    - another note about fruits
    ...
> oranges
    - oranges are orange
    - sweet orange
    ...

If I change #apples and #oranges tags to #fruits/apples and #fruits/oranges the result looks like this:

> fruits
    > apples
        - green apple
        - red apple
        ...
    > oranges
        - oranges are orange
        - sweet orange
        ...
    - oranges are orange
    - sweet orange
    - green apple
    - red apple
    - note about fruits
    - bananas
    - another note about fruits
    ...

What I want is to have something like this:

> fruits
    > apples
        - green apple
        - red apple
        ...
    > oranges
        - oranges are orange
        - sweet orange
        ...
    - note about fruits
    - bananas
    - another note about fruits
    ...

Any idea if this is possible at all? Please, suggest tagging strategy! Thanks!

vrtmrz commented 2 years ago

Thank you for asking me! Sounds like the behaviour when 'All intermediates' is set to 'Hide items'. Could you please try this configuration?

(But it getting be weird with enabling Use Virtual tags. please disable it once)

VKondakoff commented 2 years ago

Hey, hey, hey!

This is exactly what I wanted! Thanks for pointing me to this setting: it works perfectly in my example. I'll try it on a 'real life' vault and write back in a couple of days...

TafFolder is really deep! 👍

VKondakoff commented 2 years ago

I experimented a little bit further. Thanks for pointing me to the Hide items preference - I was never able to understang it before! ;) Sorry for bothering you, but I still have two questions/issues here.

First one:

  1. I'm creating four notes aaa1, aaa2, aaa3 and aaa4. All notes are tagged with #aaa tag:

    Снимок экрана 2022-10-24 в 02 13 51
  2. Now, let's say I want to hide aaa2 from the root. I'm setting Hide items to Only intermediates of nested tags and tagging aaa2 like this: #aaa/bbb. So far so good:

    Снимок экрана 2022-10-24 в 02 17 58
  3. Now I'm tagging aaa3 like this: #aaa #todo, and (surprisingly) it is removed from the root as well:

    Снимок экрана 2022-10-24 в 02 21 27

Clearly this is not what I expected, as there are no explicit nested tags in aaa3: #aaa #todo. Can we override this somehow? I'm pretty happy with the possibility to hide intermediates of nested tags, but I still want to be able to add other non-nested tags without hiding the note when using Only intermediates of nested tags Hide items option.

Second one:

I'm pretty sure there should be a way to unhid the note somehow. For example: I want notes aaa2 and aaa4 to be tagged with two tags: #aaa and #bbb:

Снимок экрана 2022-10-24 в 02 39 24

Now I want aaa2 to be hidden from the root, so I'm changing #aaa #bbb to #aaa/bbb:

Снимок экрана 2022-10-24 в 02 41 02

Oops, now both aaa2 (#aaa/bbb) and aaa4 (#aaa #bbb) are hidden. Any way to unhid the aaa4?

Thanks for your time!

VKondakoff commented 2 years ago

To summarise this: I think, enabling Hide intermediates of nested tags should automatically enable the difference between nested and plain non-nested tags with the same name (unless Don not treat nested tags as dedicated levels is enabled as well). This means, that #aaa tag is different from the #aaa portion of the #aaa/bbb tag and behaves as an usual plain tag and not the intermediate of the nested tag. If so, we can use nested tags if we want to hide notes (#aaa/bbb) and plain tags if we want a usual behaviour.

This solves both the issues from my previous message.