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 β. However, we can build our own βDataviewβ with BrainDB:
- Use remark-code-hook β to catch all code blocks with the
dataview
language - Treat the code as SQL and execute wiht BrainDB
- Translate the result to MDAST (or HTML)
Installation
-
Install BrainDB
-
Install dependencies
-
Configure Astro. See note about Rehype Plugins for Code.
Examples
Alphabetical index
Query:
Output:
Recently changed
Query:
Output:
Task list
Query:
Output:
-
Create a Rehype plugin to wrap images in a container (
<figure class="beoe"></figure>
) to avoid creating it on the client side. - Do not stretch images if they are smaller than viewport
Tags list
Query:
Output:
#code-fences