Open brimwats opened 2 years ago
The problem with that notation is it's Dataview internal mechanism that is not available in Obsidian API, do you need to include the code of dataview to be able to read that or depend on dataview for the whole plugin to work, this is the 1st point.
The 2nd and main point is actually even harder: Dataview notation is nice when you read things, however updating it, especially when we deal with lists of items is hard or even impossible - how to determine where to add new field if you have fields scattered across the document?
I'd really like to add integration with Dataview, made some attempts so far, but every time I faced some design challenges that make this integration "not nice" :(
Do far it was easier to replicate some common usage scenarios (like reading tags or reading related pages) instead of integrating dataview directly...
@tomaszkiewicz You can make use of metaedit plugin since it's provide an easy way to get/update metadata including dataview notation. I am using it for doing quick automation tasks with quickadd plugin, its api is nice to work with:
const metaedit = app.plugins.plugins.metaedit.api;
const currentFile = app.workspace.getActiveFile();
const properties = await metaedit.getPropertiesInFile(currentFile);
const tags = await metaedit.getPropertyValue("tags", currentFile);
await metaedit.update("status", "Done", currentFile);
This feature is essential for me. I don't use front matter at all, but heavily use inline fields. +1 from me!
imo the notation used in this plugin should be compatible with dataview, meaning that for example in the motorcycle example
name:: honda
with 2 colons should be accepted. I haven't tested this out fully, just an initial thought!