Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with Metadata? #13

Closed
q7z opened this issue Apr 22, 2021 · 7 comments
Closed

Doesn't seem to work with Metadata? #13

q7z opened this issue Apr 22, 2021 · 7 comments

Comments

@q7z
Copy link

q7z commented Apr 22, 2021

Tags that are edited don't seem to edit the tags in the meta-data. I am extremely dependent on your brilliant plugin for all my workflow management and updating and so I am quite cautious now to put tags in the metadata rather than the body. I'm not sure if there is a trivial fix to this?

@pjeby
Copy link
Owner

pjeby commented Apr 22, 2021

It works fine on correctly-formatted YAML in the field that Obsidian parses. To check the format, create a new note with just the metadata from a note you had trouble with, then check that if you search for tag:#sometag that's in the metadata, the new note you created should show up. (Alternately, check to see if the tag in question is listed in the "Tags" section of the "metadata" in preview.)

If it doesn't show up, then your tags are not being recognized by Obsidian, and therefore not recognized by Tag Wrangler, either. Some possible things that could cause that:

  • You used more than one tag field, or a tag field that isn't named tag or tags (case-insensitive)
  • You used # signs without enclosing the entire tag or tag list in quotes (which would comment out the rest of the line)
  • The block as a whole is not valid YAML

If your test note does show up in a tag:#sometag search and/or the "Tags" metadata, please copy its entirety into a fenced block like this in your reply, so I can try to reproduce the problem.

```yaml
---
... metadata goes here
---
```

If your test doesn't show up in the search or "Tags" metadata, you will need to correct your YAML formatting in any affected notes for Tag Wrangler to work. If it's not clear what's wrong with the formatting, you can again paste a block like the above here and I'll see if I can help you.

@q7z
Copy link
Author

q7z commented Apr 24, 2021

This is my Metadata:
Quality: &a C/2
RLEVEL: &b
Utility: &c
Field: &d
Type: &e ⚪/Figure
tags: [*a, *b, *c, *d, *e]
I do this because I want to be able to work with my tags in dataview. Is there a way that I can do this without making it a variable (and hence presumably incompatible with your extension?)

@pjeby
Copy link
Owner

pjeby commented Apr 24, 2021

Please follow the instructions I gave, both to check the formatting and to copy the entirety of the exact metadata in a fenced code block in your reply, along with the results of the tests I described. Thanks.

@q7z
Copy link
Author

q7z commented Apr 25, 2021

Apologies, I am a non-coder. I did all the tests and there is nothing wrong with the formatting. All the tags show up in the tag pane and when I change the tag (for instance here if I change C/2 to test) it updates in the pane also. So as far as I can see the metadata is working alright, or am I missing something?

---
Quality: &a C/2
RLEVEL: &b
Utility: &c
Field: &d
Type: &e ⚪/Figure
tags: [*a, *b, *c, *d, *e]
---

Thank you again for taking the time to help me I appreciate it :)

@pjeby
Copy link
Owner

pjeby commented Apr 25, 2021

Thank you. I've released 0.4.4 to fix the main problem, which was that some of the values in your tags field are nulls (all of them other than *a and *e). It was getting an error during the rename as a result. (This is why I wanted exact data, so I could be sure to reproduce the problem, rather than just guessing what was wrong.)

Unfortunately, you will likely not find my fix to be entirely satisfactory, since it will not maintain the linkages you've set up when you rename a tag: it will simply replace the *a or *e with the referenced tag, and leave the values in the other fields alone. For example, if you rename C/2 to test, you will get this:

---
Quality: &a C/2
RLEVEL: &b 
Utility: &c 
Field: &d 
Type: &e ⚪/Figure
tags: [ test, *b, *c, *d, *e ]
---

Which I am guessing is not what you want. The method I am using to update the tags field is not smart enough to be able to tell that you want the other values to be changed as well, and I don't see any easy way to change that in the near future.

@pjeby pjeby closed this as completed Apr 25, 2021
@q7z
Copy link
Author

q7z commented Apr 25, 2021

Thanks! I don't have a problem with this implementation! Do you have any suggestion how I could alter my workflow where I could keep variable fields with tags, should I separate tags from the metadata? I'm just thinking if there's a way to do this without storing variables and using them as tags in an array

@pjeby
Copy link
Owner

pjeby commented Apr 25, 2021

I'm not sure I understand your question, but I think the answer is, "it depends on what you're trying to accomplish".

For example, I have no idea why you're doing it the way you are now, so I'm not sure I know how to suggest doing it better. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants