Dataview: reuse DQL queries?

Hi,

I’m the new guy around here, and I’ve got some tips and questions related to this topic. Which might be off target completely, but here goes.

First of all, using the Plaintext plugin, and adding js as an extension, one is able to edit javascript within Obsidian, albeit without some of the bells and whistles of a more dedicated code editor, like Visual Code 2. Only downfall so far, is that to create the file initially you either need to create an ordinary note within Obsidian, and rename it from .md to .js outside of Obsidian. Or you’ll create the file outside of Obsidian.

Secondly, I found a view such files with syntax highlighter, see my own answer in my own thread: Raw embed of javascript into a code block? - #3 by holroy :smiley:

Lastly, is there a particular reason you’re using dv.execute() instead of dv.query()? The latter seems to have an option to pass a file, pretending to be this, so that it can mimic being on the original note even more than what dv.execute() seems to do. It would also allow for even more post-processing, and handling after query execution if one would want that. See Dataview: Function to get length of unique values OR using nested queries - #2 by holroy, for an example where I post process a DQL query to show summary of the summaries.