Taitava / obsidian-shellcommands

Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
351 stars 11 forks source link

[Feature Request] New Variable `{{tags}}` #51

Closed FelipeRearden closed 2 years ago

FelipeRearden commented 2 years ago

This FR are being discussed here: #50

A new variable to manipulate tags from the active note based on the distinctive pattern.

Taitava commented 2 years ago

Done, will be released in 0.5.0.

Just one thing came to my mind: Each tag is prefixed with a #. If you don't want it, create another feature request about adding a second parameter (Something like {{tags:separator:no-hash}}) that would remove the # from tags.

FelipeRearden commented 2 years ago

Thank you very much @Taitava !!!!!!!!!!!!

If you don't want it, create another feature request about adding a second parameter (Something like {{tags:separator:no-hash}}) that would remove the # from tags.

Thanks for remembering this. I will see if a tag without hash is need and I let you know with a new FR !!

Thank you very much @Taitava !!! This new variable is going to help me a lot :)

Taitava commented 2 years ago

Implemented & released in 0.5.0.

Taitava commented 2 years ago

Each tag is prefixed with a #. If you don't want it, create another feature request about adding a second parameter (Something like {{tags:separator:no-hash}}) that would remove the # from tags.

If this is needed, it's now possible to do, as #43 is now done.

FelipeRearden commented 2 years ago

Hello @Tataiva!!!!!!!!!!!!

The :separator is fantastic and brings this variable to a level of customization that is amazing (more of this topic above)

I'd like to address 2 things for you:

1- Remove Duplicates Records (Distinctive)

In the example below, I have the tag grape repeating three times. When using this Shell Command, we have this

echo "{{tags:\n}}" | pbcopy

Screen Shot 2021-10-03 at 07 24 32

For tags I think would be a good idea to have one record of each tag as we talked in #50 :)

2- Tags inside YAML + :no-hash

Just one thing came to my mind: Each tag is prefixed with a #. If you don't want it, create another feature request about adding a second parameter (Something like {{tags:separator:no-hash}}) that would remove the # from tags.

Short conclusion: we need a no-hash separator to use all Obsidian Tags features.

Yesterday I was studying how Obsidian deals with tags. There are three ways to apply tags to a note

A- Inside the Note

The way we know without thinking too much ...

Screen Shot 2021-10-03 at 07 33 31

B- YAML: A List of Tags

Screen Shot 2021-10-03 at 07 34 07

tags:
- info01
- info02
- info03

Your approach is so clever that we can create this with the tag variable:

echo - "{{tags:\n- }}" | pbcopy

Screen Shot 2021-10-03 at 07 44 10

C- YAML: A Vector of Tags

Screen Shot 2021-10-03 at 08 33 21

tags: [info01,info02,info03]

Again, your approach is so clever that we can create this with the tag variable as well:

echo ["{{tags:,}}"] | pbcopy Screen Shot 2021-10-03 at 08 31 30


After seen this, I'd to request, if possible, the no-hash separator. This way we close all the cases for tags variable in Obsidian :)

Sorry If I didn't get all of this in the first post of my FR. As a tester, this is my fault :(

As a user, I think the YAML approach is the best fit for me, because I can hide the yaml in the preview mode (since will be a huge list of tags from a book for example)

I will open a new FR as you said, but I just wanna explain before doing the FR :)


I really love this variable and what we can and will can do with :separator. It's groundbreaking

Thank you soo much for everything. You are super :)

Taitava commented 2 years ago

For tags I think would be a good idea to have one record of each tag as we talked in #50 :)

Damn, I forgot this duplicate test! Sorry! 🙁 My fault, not yours! 🙂 I count this as a bug and will reopen this issue, to handle this duplicate tags issue here.

I'll write about an idea regarding the no-hash thing in #62 .

I really love this variable and what we can and will can do with :separator. It's groundbreaking

Thank you soo much for everything. You are super :)

Thanks for the feedback! Good to hear that it (almost) works as intended! 🌞

FelipeRearden commented 2 years ago

Damn, I forgot this duplicate test! Sorry!

No problem at all. You have to deal with so many aspects of the feature that its normal :)

That's why I think that every user that open as FR have the responsibility to test the FR and give feedback to the developer.

Your #62 approach is AMAZING !!!!!!

Thanks again @Taitava !!!!

Taitava commented 2 years ago

Damn, I forgot this duplicate test! Sorry! 🙁 My fault, not yours! 🙂 I count this as a bug and will reopen this issue, to handle this duplicate tags issue here.

I'll actually create a new issue for this bug.

FelipeRearden commented 2 years ago

I'll actually create a new issue for this bug.

Ok @Taitava !!!!