udus122 / dataview-publisher

Output markdown from your Dataview queries and keep them up to date. You can also be able to publish them.
MIT License
25 stars 0 forks source link

[HELP] Support for inline DQL queries ? #48

Open Nidwan opened 6 days ago

Nidwan commented 6 days ago

Hi there,

Thanks a lot for your plugin, I use it everyday for Obsidian Publish.

I would like to publish this inline DQL query : = dateformat(this.file.mtime,"DDDD : HH:mm") If I'm not mistaken, your plugin only supports blocks. Is it possible to avoid creating a table, while still outputing Markdown or HTML? It's just to save a bit of space : I'd like to display something like "Last updated on XX XX XX" only on one line.

Any other hints are also very welcome.

Thanks

udus122 commented 20 hours ago

@Nidwan Thank you for using my plugin.

How about doing something like this?

%% DATAVIEW_PUBLISHER: start
```dataviewjs
`Last updated on ${moment(dv.page("Home").file.mtime).format("YYYY-MM-DD dddd : HH:mm")}`

%%

%% DATAVIEW_PUBLISHER: end %%



This is very experimental support, but it is possible to output the results of JavaScript execution using `eval`.

In the future, we would like to support dataview functions.
However, we have not had enough time to work on this yet.