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

Support for YAML tags like Dataview (use ::) #9

Open
jaroet opened this issue Jul 16, 2021 · 5 comments
Open

Support for YAML tags like Dataview (use ::) #9

jaroet opened this issue Jul 16, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@jaroet
Copy link

jaroet commented Jul 16, 2021

Would be great when YAML tags (might strictly not be a correct name) with :: are supported. Like dataview plugin introduced them. Something like : location:: lat, long

This is specially usefull when (another enhancement request) it is possible to use an address for example as the location point. Then you can place the address in a normal place in the note and not specific in the YAML frontmatter.

@esm7
Copy link
Owner

esm7 commented Jul 17, 2021

Can you elaborate more on how you'd use these YAML tags? Especially with relation to textual addresses which I want to add soon?

@jaroet
Copy link
Author

jaroet commented Jul 17, 2021

Let me explain ... Most of my person notes like something like this:

John Doe

tags:: #person/work, #2021

birthday:: 1971-01-01
address:: Main street 1
zipcode :: 123456
company:: Google
company_role:: consultant
department::

and some more fields that you all can read with dataview plugin ... like

known_from:: where did I meet this person
work_life:: short summary about work situation
personal_life:: short summary about personal situation

Not all fields are always filled in and sometimes not all fields are even there (started using template later on so I still have to fix thats.

Depending on my needs I can create a very specific dataview query based on the fields above. Like when I visit a company who do I know and what role and work_life information do I have on those people. Or if I need a carpenter for example who do I already know that has the role carpenter.

Plotting this information is very usefull. The reason that I do not have all of this information in the YAML section is
a. I really do not like the YAML presentation at the top of the page
b. It does not show above but these fields are seldom all grouped at the top of the page. Specially the work_life and personal_life fields can be on different places in the note. And I like it that way... makes for more natural notes style.

writing this I think I might have underestimated the work needed to be done to facilitate that specially if you also want to add a filter based on those fields. Like role:: carpenter to see all the carpenters you know.

And then there is the fact that you currently only use location: to find that datapoints for the map. If that could be made configurable that would be great. In my case ... address:: would be the datapoint you are looking for. But that might be a whole new FR.

@esm7
Copy link
Owner

esm7 commented Jul 17, 2021

That would be extremely useful, and is also important for my attempt of Map View to fit as a complementary view of notes in the complete ecosystem next to graph view.
The main difficulty with what you're suggesting is that it would currently require the map view plugin to parse all notes and cache the results, while using frontmatter tags (as I'm currently doing) does that work already.
Seems like the Dataview plugin has plugin-facing API in plan but it's not available yet. If this becomes available, Map View can ask Dataview for a query on its already-cached data rather than read all notes by itself and mimic the syntax.
I'll ask the Dataview developer for if and when this can be accessed.

@esm7
Copy link
Owner

esm7 commented Jul 17, 2021

Update: the API is there (https://github.com/blacksmithgu/obsidian-dataview/blob/master/src/api/plugin-api.ts) and seems like it has all the building blocks that I need.

@jaroet
Copy link
Author

jaroet commented Jul 17, 2021

Wow ... that was fast !

I am not familiair with API's and stuff but it looks like you want to use the dataview index (generated at the start of obsidian if I understand correctly) to ask for all notes you need. That would be great.

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

No branches or pull requests

2 participants