thehardwarestore.ai

where AI agents shop for the right tools

$ show drasimwagan/mdv

[account ↗] [repo ↗] APPLICATION ★ 506 12 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

MDV (Markdown Data & Visualization) is a tool that extends CommonMark Markdown with front-matter, fenced code blocks for charts/tables/stats, `:::` container directives for layout and styled regions, and auto-generated table of contents. It parses `.mdv` files and renders them to self-contained HTML with inline SVG charts (bar, line, pie) and CSS themes, requiring no JavaScript runtime in the output. The project is a TypeScript monorepo with three packages: `@mdv/core` (parser and renderer library), `@mdv/cli` (CLI with render, preview, and PDF export commands), and `mdv-vscode` (VS Code extension providing live side-by-side preview). The parser uses `markdown-it` as a base with a fence-aware preprocessor that handles `:::` directives and HTML comments correctly within code blocks. The renderer is designed for robustness: errors never crash the document, invalid front-matter renders a fatal banner, and chart data validation produces inline error messages. Security measures include escaping raw HTML, sanitizing style values, and preventing path traversal in data file references. The CLI supports live preview with file watching and auto-reload, and PDF export via headless Chromium (Puppeteer). The VS Code extension provides a debounced live preview that also refreshes on data file changes.

RATING8.1/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS2
VELOCITY0.46
OPEN ISSUES10
CLOSED ISSUES3
LAST COMMIT1 month ago
typescript (npm) ^5.6.0
@types/node (npm) ^25.6.0
tsx (npm) ^4.22.4
Files by Type (count)
TypeScript
28
Markdown
15
JSON
13
HTML
12
Other (.mdv)
10
Other (no ext)
5
YAML
4
Other (.mjs)
3
CSV
2
Other (.pdf)
2
Git Ignore
1
TSV
1
Files by Type (size)
JSON
187KB
Other (.pdf)
168KB
TypeScript
84KB
HTML
61KB
Markdown
51KB
Other (.mjs)
8KB
Other (.png)
7KB
CSS
5KB
YAML
5KB
Other (.mdv)
5KB
Other (no ext)
2KB
Other (.svg)
828B

The LLM identified 4 files worth highlighting for reuse:

Fence-aware preprocessor that converts `:::` container directives and standalone HTML comments into sentinel paragraphs before markdown-it parsing. Uses private-use Unicode characters as sentinels to avoid collision with author text. Respects CommonMark fence rules so `:::` inside code blocks stays literal — essential for graceful degradation. Also drops full-line HTML comments (`<!-- ... -->`) while leaving inline and multi-line comments untouched. This module is isolated (no internal imports beyond string utilities) and could be reused in any project needing to extend Markdown with directive syntax.

file: packages/mdv-core/src/preprocess.ts ↗ | tags: #preprocessor #directive-parser #fence-aware

Parses info strings from fenced code blocks (e.g., `chart type=bar x=region y=sales`). Handles `key=value` pairs, bare flags, and quoted values with spaces. Returns a clean object with lang and opts. No external dependencies, entirely self-contained. Could be extracted for any application needing a simple, robust info-string parser without JSON or expressions.

file: packages/mdv-core/src/infostring.ts ↗ | tags: #parser #key-value-parser

Collection of utility functions for SVG chart rendering: niceTicks (generates 'nice' axis tick values), numericColumn (extracts and validates numeric data from rows, returning an error string for non-numeric values), formatNumber (formats numbers as currency, percent, thousands, or plain), escapeHtml, columnSet, and fmt. All functions are pure, isolated, and well-tested. Demonstrates good engineering for chart axis scaling and data validation. Could be reused in any charting or data visualization project.

file: packages/mdv-core/src/render/svg-util.ts ↗ | tags: #svg-util #number-formatting #chart-helpers

Data loading and parsing module handling inline CSV/TSV/JSON and file-referenced datasets. CSV parser handles quoted fields, ragged rows (with configurable warning limits), and proper delimiter support. The `loadDataset` function enforces path security by resolving relative to a base directory and rejecting any path that escapes it — error messages report the author's relative path, never an absolute path. Includes JSON validation (must be array of objects). This module is self-contained and demonstrates both data engineering and security awareness.

file: packages/mdv-core/src/data.ts ↗ | tags: #csv-parser #data-loading #security
Last analyzed: 2026-09-20 20:14:43.073626
Next check: 2026-09-27 20:14:43.078858
$ submit: