I’m wondering if it’s possible to create a Dataviewjs script that would be able to output a markdown table, so that the resulting markdown file could be run through Pandoc and styled easily in a word processor without a lot of CSS tweaking.
Pretty good! But now the question is getting this into a form to share with students. I can export to PDF, but it’s not quite right and I’d rather tweak in a word processor than via CSS. I’m pretty familiar with using a docx reference file in Pandoc, so that’s my thinking right now, although I’d certainly be interested in other folks’ ideas along these lines.
My non-scripting workaround for what you’re describing:
Install Typora and set it as the “Default App” in Obsidian
Open the note in Obsidian and then choose “Open in Default App” from the ‘three dot menu.’
Note opens in Typora
Export note from Typora in whatever format you need. If you have pandoc installed and on your path, the export options include .doc, .rtf, and several others.
Open in your word processor, tweak the doc, and publish.
This is a bit more effort than running a script, but only marginally so. And the results are consistently good because, well, pandoc.
Ok @Christian , I had a chance to tinker already and it works! Thanks. However, one question. How can I change the query to look in a particular folder instead? I’d like to have something like this, but it’s throwing an error:
Edit: const pages = dv.pages('"teaching/65011 - Teaching and Interpreting"').where(f => f.theme && f.readings); seems to work fine for me. Even without the where.
In the code, it’s assumed that every page in pages has a day, week, theme, and readings property. So if, like you mentioned, a page is incomplete in its properties, the code fails.
I used const pages = dv.pages('"teaching/65011 - Reading & Interpreting"').where(f => f.theme && f.readings) to make sure that every page found has both the theme and readings properties - and even that may fail in the case that those pages don’t have a day and week property.