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

question - how to scan file(s) for tags and add them into the yaml header? #57

Open
aisbergde opened this issue Jun 4, 2020 · 2 comments

Comments

@aisbergde
Copy link

Are there any ideas how files could be parsed to find tags that follow some syntax (for example #aaa, +bbb, @ccc and add them into the YAML header if not yet there?

And maybe also to remove non existing tags from YAML header?

I tried with powershell and regex and I think I would be able to find tags, but then they should be included into the yaml header to get them listed. And I am not a specialist for powershell, maybe there is something ready to use?

I know this is not a feature of this extension, but it is somehow related, because I want to use tags when I write text directly in the text and they should be available.

@blakedietz
Copy link
Owner

blakedietz commented Jun 29, 2020

Ah, so are you requesting a custom tag directive to use instead of @nested-tags? Are you essentially looking to define a custom tag in the header which would then be parsed in the file itself and added to the tag tree?

@aisbergde
Copy link
Author

aisbergde commented Jun 29, 2020

your comment shows a nice way how to do.

Another idea I have is to process files to scan for tags and to write them into the yaml header.
Scanning for tags I did with a simple PowerShell script and regex search. This works fine. This is a read only operation and it will not change the file content. Now I think if I also should read the yaml front matter content, update the tag list and write back the yaml front matter, but this is no more a read only operation.

I don't know how the extensions scanes for tags, if regex is used, then maybe some additional setting for the whole extension could add additional search patterns to be detected?

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