Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataview js not showing any output #179

Open
wheresalice opened this issue Jun 13, 2023 · 4 comments
Open

dataview js not showing any output #179

wheresalice opened this issue Jun 13, 2023 · 4 comments

Comments

@wheresalice
Copy link

My dataview JS query isn't rendering on site

The following code produces a count of countries that I have visited when used in Obsidian

- Visited Countries: `$=dv.pages('"travel/countries"').where(p => p['visited']>0).length`

But the published version renders this as <li>Visited Countries: </li>

Do I need to do something differently to make this work?

@jonathanhung
Copy link

I also ran into the same issue

@jonathanhung
Copy link

jonathanhung commented Sep 14, 2023

Reporting back, it looks like when you use dataview (not dataviewJS) table and list it will render... perhaps has to do with dataviewJS not being rendered into HTML...? Not an expert in dataviewJS, but I'm guessing you'll have to wrap what you get back into HTML/CSS

image

first block is dataviewJS, second and third done with dataview

@jonathanhung
Copy link

jonathanhung commented Sep 20, 2023

remains an issue after trying a few different things.

Image 1: shot from my repo after using dataview List
image

Image 2: shot from my repo after using dataviewJS list
image

image 3: inspecting obsidian shows identical markup except one is wrapped in <div class=block-language-dataviewjs
image

Not sure where in the code you detect dataview blocks and render them into markdown but it looks like it needs to also look for class="block-language-dataviewjs"

cc @oleeskild

@jonathanhung
Copy link

tried removing hideDataview from index.njk but still isn't rendering.

{{ content | hideDataview | link | taggify | safe}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants