obsidian-export icon indicating copy to clipboard operation
obsidian-export copied to clipboard

Add dataview support

Open slnc opened this issue 2 years ago • 4 comments

When I export an Obsidian note with a https://github.com/blacksmithgu/obsidian-dataview query snippet, I get an .md file with the dataview query, not the query results because dataview executes queries within the Obsidian apps.

Is there any way to make Obsidian Export talk to the dataview plugin to render query results? I publish my own Obsidian vault to a static site thanks to Obsidian Export, and I would love to use dataview but right now I can't because I know that some of my published notes will be broken. Popular frameworks like LYT Kit v6 are now also using dataview, so I expect that more and more people would benefit from this feature.

Adding @blacksmithgu in case he has any idea about how we could do this.

And more context on this issue: https://forum.obsidian.md/t/hybrid-of-dataview-and-textexpand/16656

slnc avatar May 13 '22 08:05 slnc

I am working on dataview export functionality currently that replaces dataview blocks with markdown equivalents, so that may help in this context.

blacksmithgu avatar May 14 '22 03:05 blacksmithgu

I am working on dataview export functionality currently that replaces dataview blocks with markdown equivalents, so that may help in this context.

That's great news, thanks Michael. Do you have any available spec or docs about how it would work? If not, no worries, I will wait. I was curious to see if there is anything that can be done in parallel to make obsidian-export work with that feature.

slnc avatar May 17 '22 14:05 slnc

At a high level, the export functionality will support:

  1. A simple user UI for converting specific views or ALL views to plain Markdown.
  2. A programmatic API for converting a query to raw Markdown.

Obsidian Export would probably need to add a little functionality to call the API on dataview blocks to convert them to raw markdown; alternatively, users would render all of their views to markdown and then call export.

blacksmithgu avatar May 19 '22 22:05 blacksmithgu

In the meantime... see https://forum.obsidian.md/t/dataviewjs-snippet-showcase/17847/225?u=lise for a way to create a static dataview table using a templater template.

filmgal avatar Jul 21 '22 22:07 filmgal