breadcrumbs
breadcrumbs copied to clipboard
breadcrumbs dataview note should support dataviewjs
dataviewjs can do advanced manipulation. If dataview query is supported, dvjs should be supported as well.
I don't think there is a simple way to do this...
The Dataview API doesn't even expose a way to run regular WHERE
queries, so a full dvjs snippet is probably less likely. I'm constrained by what the API can do, you see?
Isn't it possible to just directly execute that dataviewjs block as js code? Or will it not pick up the dv api calls then, in which case you might be able to pass it onto the js execution engine
I don't think it will recognise what dv
is.
I guess it depends what context the code is executed in? But the console doesn't recognise dv
, for example, so it won't work on a global scope
I don't know if this works. I can write normal js code in dvjs codeblock. Can I call a breadcrumb API in the dvjs codeblock to update the breadcrumbs? Then I can use both dvjs and breadcrumbs.
But for sure the dvjs file must be able to run in background.
@SkepticMystic @HEmile I think the dv
in dvjs codeblock is the same as the getAPI()
exposed by the dataview. is it possible to run a regex to replace every dv
in the codeblock by getAPI()
and then pass to js execution engine?
@HananoshikaYomaru I don't know if you've seen this message yet, but I've exposed an API you can use in dvjs blocks: https://discordapp.com/channels/686053708261228577/855181471643861002/942003316123119646
@HananoshikaYomaru I think you'd be able to set a variable called dv to getAPI() to ensure the javascript would recognize it. At least that's how it works in other languages, I've never done this in Javascript.
Note, there's a Dataview API method called executeJS
that looks promising. I need to see if it's a superset (can execute regular dv queries as well), or if I need a way to specify. Also, what shape does it return?
See Discord thread for context: https://discord.com/channels/686053708261228577/1014259487445622855/1223887591229886474
After more investigating, executeJS
doesn't do what I expected. It does more than just run the DVJS query, it needs something to render the results into. For that reason, I don't intend to implement around that. If they expose an API to just get the results, I'll reopen this!
As mentioned in a previous comment, the BC API can be used in a DVS codeblock, so atleast there's an integration in that direction