Obsidian Dataview
Dataview is a live index and query engine over your personal knowledge base. You can add metadata to your notes and query them with the Dataview Query Language to list, filter, sort or group your data. Dataview keeps your queries always up to date and makes data aggregation a breeze.
Dataview is a plugin for Obsidian. There is a way, though, buiuld your own βDataviewβ for Astro. In order to do so one needs:
- remark-code-hook, to cath all codeblocks with
dataview
language - Parse code as DQL (SQL-like language)
- Translate (aka compile) DQL AST to BrainDB calls
- Translate result to MDAST (or HTML)
Proof of concept
It will take time to repeat full functionality, so lets start with one simple case:
Implementation
-
Install BrainDB
-
Install
remark-code-hook
-
Create
remarkDataview
-
Configure Astro
-
Use BrainDB to extract tsasks
Beyond proof of concept
For now this is PoC. For full version we need:
I tried to extract original DQL parser. Not sure about this approach though.
Example
This is an example of output π
- show labels for tags on the graph
- create an example with client-side graph
- Implement area-proportional diagram. Maybe edeap.
- Try to implement it without headless browser
- I created basic proof of convept using facets and InstantSearch. I don't like it, though. It supports facets for:
- I still can use
facets
orpagefind
, but I need different UI. - Other potential fields for facets
- Sort by
- One more idea is to add
favicon
of the target instead ofβ
.
- schema.org microdata
- sitemap (
lastmod
)
- handle non-html links (images, pdfs)
- generate gradient based on tag colors
- style pan-zoom buttons
- create rehype plugin to wrap images into container (
<figure class="beoe"></figure>
), to avoid creating it on the client side
- fix bug: it crashes if there are missing header levels, like
h4
directly inh2
- fix "snake" styles
- page for each tag
- metadata for tags (color, icon)
- removed
Graphviz
component from the repo need to use@beoe/astro-graphviz
instead
- support anchors in wikilinks (
[[page#anchor]]
,[[page#anchor|alias]]
) - check that anchors correspond to some header in target document
- what about ambiguous links (
bdb.documentsSync({ slug: permalink }).length > 1
)? - image wikilinks (
![[some.jpg]]
)