You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: As a plugin creator I would like to register JS functions from my plugin to be accessible during DQL dataview queries.
I wrote a simple plugin where you can identify key "notes" and have access to them in other files using JS.
A quick example for that plugin would be a project. You can define a md file as the project using a specific metadata key, and then when you are in a note in the same folder or nested down the folder tree you can access the metadata for that file.
I created a global variable (sn) which I can call now in templater and dataviewjs which allows me to access that data (for example, I can get the project name inside an issue for that project = sn.type_project('name'))
I would like to register this function in dataview's query language because most of the time I really just want to make simple queries for lists and don't want to write js code:
TABLE
sn_type_project("name"),
title,
WHERE
type = "issue" AND
!contains(file.path, "template")
I looked at the API and I don't see a way to do this.
Is there a way to do this currently and is there any opposition in creating a way to allow other plugins to add DQL functions?
If there is interest I can work on it and submit a PR once its implemented.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TLDR: As a plugin creator I would like to register JS functions from my plugin to be accessible during DQL dataview queries.
I wrote a simple plugin where you can identify key "notes" and have access to them in other files using JS.
A quick example for that plugin would be a project. You can define a md file as the project using a specific metadata key, and then when you are in a note in the same folder or nested down the folder tree you can access the metadata for that file.
I created a global variable (
sn
) which I can call now intemplater
anddataviewjs
which allows me to access that data (for example, I can get the project name inside an issue for that project =sn.type_project('name')
)I would like to register this function in dataview's query language because most of the time I really just want to make simple queries for lists and don't want to write js code:
I looked at the API and I don't see a way to do this.
Is there a way to do this currently and is there any opposition in creating a way to allow other plugins to add DQL functions?
If there is interest I can work on it and submit a PR once its implemented.
Beta Was this translation helpful? Give feedback.
All reactions