Render Obsidian Dataview queries directly within VSCode's built-in Markdown preview.
This extension brings the power of dynamic data querying to your Markdown workspace in VSCode. It indexes your Markdown files (frontmatter, tags, lists, tasks) and allows you to query them using the Dataview Query Language (DQL).
Screenshots
Example: Querying daily notes with weather and mood data
Features
Dataview Query Language (DQL) Support:
TABLE: Create tables with columns from file properties.
LIST: List files or properties.
FROM: Filter by folder or tags.
WHERE: Filter results based on fields.
SORT: Sort results by any field.
FLATTEN: Unroll lists (e.g., tasks) into individual rows.
AS: Rename columns (e.g., file.day AS "Date").
Seamless Integration: Works directly in VSCode's standard Markdown preview.
Live Updates: Preview updates automatically when you save files or switch editors.
Clickable Links: File links in tables and lists open directly in the VSCode editor.
Installation
Option 1: Install from VSIX (Recommended)
Download the latest .vsix file from the Releases page
Open VSCode
Open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux)
Type "Extensions: Install from VSIX..." and select it
Navigate to the downloaded .vsix file and select it
Reload VSCode when prompted
Option 2: Install from Source (For Development)
Clone this repository:
git clone https://github.com/yahsan2/vscode-dataview-preview.git
cd vscode-dataview-preview
Install dependencies:
npm install
Compile the extension:
npm run compile
Open the project in VSCode:
code .
Press F5 to launch a new VSCode window with the extension loaded
Verify Installation
After installation, open any Markdown file with a dataview code block. The preview should automatically render the query results.
Usage
Simply add a dataview code block to your Markdown file:
TABLE file.day AS "Date", weather, mood
FROM "daily"
WHERE mood = "good"
SORT file.day desc
Supported Fields
file.name: File name
file.path: Absolute file path
file.link: Clickable link to the file
file.day: Date extracted from frontmatter (date) or filename (yyyy-mm-dd)
file.ctime: Creation time
file.mtime: Modification time
file.tags: List of tags
file.lists: List items in the file (useful with FLATTEN)
Any YAML frontmatter property
Demos
Check out the Demo Gallery for practical use cases: