View .hd documents rendered directly in VS Code with charts, Mermaid diagrams, tabs, callouts, and HD plugins.
Features
- Rendered preview for
.hdfiles through a custom editor. - Source, preview, and split modes from the editor title bar, command palette, and standard preview keybindings.
- Live updates as you edit
.hdsource. - Plugin auto-loading for trusted HD component plugins (
*.hd.js):- Workspace plugins from
plugins/,hd-plugins/, or.hd/plugins/. - Global plugins from the folder set in
hd.globalPluginFolder. - Previews refresh automatically when a plugin file changes.
- Workspace plugins from
- Theme-aware rendering that follows the active VS Code theme.
- Syntax highlighting for
.hdsource.
Usage
- Open a
.hdfile. It opens in the rendered HD viewer by default. - Use the editor title buttons or command palette to switch modes:
HD: Source Modeopens editable source.HD: Split Source / Previewopens source on the left and preview on the right.HD: Preview Modeopens the rendered preview.
- Use
Cmd+Shift+V/Ctrl+Shift+Vto open preview mode from source. - Use
Cmd+K V/Ctrl+K Vto open split source/preview mode. - Add trusted plugin files such as
mindmap.hd.jsto your workspaceplugins/folder to render custom HD components.
Settings
| Setting | Default | Description |
|---|---|---|
hd.pluginGlobs |
["plugins/*.hd.js", "hd-plugins/*.hd.js", ".hd/plugins/*.hd.js"] |
Workspace-relative globs of plugins to auto-load. |
hd.globalPluginFolder |
"" |
Absolute path to a folder of global plugins. |
Security note
HD documents are inert data and are sanitized before rendering. Plugins are code and run inside the preview webview. Only put plugin files you trust into your plugin folders; treat them like any other dependency you add to a project.
Development
No build step is required; the extension is plain JavaScript.
- Open the
vscode-extension/folder in VS Code. - Press
F5to launch the Extension Development Host. - Open any
.hdfile in the dev window.
Package locally:
npm run build:local
npm run install:local
Publishing
npm run package
npm run publish
Publishing requires a Visual Studio Marketplace publisher named wishlatte and a valid VSCE_PAT.