Live preview wiremd mockup files with multiple visual styles directly in Obsidian.
- Live Preview: Automatically render wiremd code blocks as interactive previews
- 7 Visual Styles: Choose from sketch, clean, wireframe, tailwind, material, brutal, or none
- Quick Style Switching: Click the style badge to quickly change preview styles
- Export Functionality: Export wiremd previews as standalone HTML files
- Mobile Optimized: Touch-friendly interface with responsive design
- Debounced Rendering: Smooth performance with configurable render delays
- Command Palette Integration: Quick access to all features via Obsidian commands
-
Clone this repository into your Obsidian vault's plugins folder:
cd /path/to/your/vault/.obsidian/plugins/ git clone https://github.com/akonan/wiremd-obsidian.git wiremd-preview cd wiremd-preview
-
Install dependencies:
npm install
-
Link local wiremd (if not using published version):
cd ../../../wiremd # Navigate to wiremd project npm link cd - # Back to plugin directory npm link wiremd
-
Build the plugin:
npm run build
-
Enable the plugin in Obsidian:
- Open Obsidian Settings
- Navigate to Community Plugins
- Reload plugins
- Enable "Wiremd Preview"
- Download the latest release
- Extract
main.js,manifest.json, andstyles.cssto your vault's.obsidian/plugins/wiremd-preview/folder - Reload Obsidian
- Enable the plugin in Settings → Community Plugins
Create a wiremd code block in your markdown file:
```wiremd
## Login Form
Username
[____________________________]
Password
[****************************]
[Sign In]{.primary} [Cancel]
```The plugin will automatically render it as an interactive preview!
The plugin supports 7 distinct visual styles:
- Sketch (default): Hand-drawn Balsamiq-inspired look
- Clean: Modern minimal design
- Wireframe: Traditional grayscale with hatching
- Tailwind: Utility-first design inspired
- Material: Material Design inspired
- Brutal: Neo-brutalism with bold colors
- None: Unstyled semantic HTML
Quick Method: Click the style badge in the top-right corner of any preview
Settings Method:
- Open Settings → Wiremd Preview
- Select your preferred default style
Command Palette:
- Press
Ctrl/Cmd + P - Type "Wiremd: Set style to..."
- Choose your desired style
[Button Text] # Basic button
[Button Text]{.primary} # Primary button
[Button Text]* # Primary (shorthand)
[Button Text]{:disabled} # Disabled state
[_____________________________] # Text input
[Email_________________________] # With placeholder
[_____________________________]{type:email} # With type
[*****************************] # Password input
## Navigation Bar {.nav}
[[ Logo | Home | Products | About | [Sign In] ]]
## Features {.grid-3}
### Feature One
Description here
### Feature Two
Description here
### Feature Three
Description here
## Hero Section {.hero}
> # Welcome to Our Product
> Transform your workflow with our amazing tool
> [Get Started]{.primary} [Learn More]
For complete syntax documentation, visit wiremd documentation.
The plugin adds the following commands to Obsidian:
- Wiremd: Set style to [style] - Change the default style (7 commands, one per style)
- Wiremd: Toggle auto-preview - Enable/disable automatic preview rendering
- Wiremd: Refresh all wiremd previews - Manually refresh all previews
- Wiremd: Export selected wiremd as HTML - Export current wiremd block as standalone HTML
- Wiremd: Export selected wiremd with all styles - Export current wiremd block in all 7 styles
- Wiremd: Copy selected wiremd HTML to clipboard - Copy HTML to clipboard
Access settings via Settings → Wiremd Preview:
- Visual Style: Choose default rendering style
- Auto Preview: Toggle automatic preview rendering
- Render Delay: Adjust debounce delay (0-1000ms, default: 300ms)
- Place your cursor inside a wiremd code block
- Open Command Palette (
Ctrl/Cmd + P) - Run "Wiremd: Export selected wiremd as HTML"
- File will be downloaded automatically
Export the current wiremd block in all 7 styles at once:
- Place cursor in wiremd block
- Run "Wiremd: Export selected wiremd with all styles"
- Seven HTML files will be downloaded
Quickly copy the rendered HTML:
- Place cursor in wiremd block
- Run "Wiremd: Copy selected wiremd HTML to clipboard"
- Paste anywhere!
The plugin is fully optimized for Obsidian mobile:
- Touch-Friendly: Larger touch targets (44x44px minimum)
- Responsive Layout: Adapts to phone and tablet screens
- Optimized Performance: Increased render delays on mobile to reduce resource usage
- Smart Positioning: Style selector adapts to available screen space
- Smooth Scrolling: Momentum scrolling for wide previews
wiremd-obsidian/
├── src/
│ ├── main.ts # Plugin entry point
│ ├── settings.ts # Settings interface and tab
│ ├── preview.ts # Preview processor
│ ├── export.ts # Export functionality
│ ├── mobile.ts # Mobile optimizations
│ └── styles.css # Plugin styles
├── manifest.json # Plugin metadata
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── esbuild.config.mjs # Build config
└── README.md # Documentation
# Development mode with watch
npm run dev
# Production build
npm run build
# The build command runs:
# 1. TypeScript type checking
# 2. esbuild bundling- wiremd: Core library for parsing and rendering
- obsidian: Obsidian API types
- typescript: Type checking
- esbuild: Fast bundling
The plugin includes comprehensive test coverage with 58 tests using Vitest:
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with UI
npm run test:ui
# Run tests with coverage report
npm run test:coverageTest Coverage:
- ✅ Mobile optimizer (23 tests)
- ✅ Settings module (12 tests)
- ✅ Export functionality (10 tests)
- ✅ Preview processor (13 tests)
Tests include:
- Unit tests for all core modules
- Mocked Obsidian API for isolated testing
- DOM manipulation testing with happy-dom
- Async operations and debouncing tests
- Error handling scenarios
- Ensure
main.js,manifest.json, andstyles.cssare in.obsidian/plugins/wiremd-preview/ - Check Obsidian console (Ctrl/Cmd + Shift + I) for errors
- Try disabling and re-enabling the plugin
- Check that Auto Preview is enabled in settings
- Verify code block uses
```wiremd(with three backticks) - Look for syntax errors in your wiremd code
- Increase Render Delay in settings (try 500-1000ms)
- Disable Auto Preview for large documents
- Use Command Palette to manually refresh when needed
- Ensure your cursor is inside a wiremd code block
- Check browser console for errors
- Try copying to clipboard instead
MIT License - See LICENSE file for details
- Built with wiremd by akonan
- Inspired by Obsidian's amazing plugin ecosystem
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Report issues: GitHub Issues
- Documentation: See OBSIDIAN_PLUGIN_GUIDE.md
- Wiremd docs: wiremd repository
- ✨ Live preview for wiremd code blocks
- 🎨 7 visual styles (sketch, clean, wireframe, tailwind, material, brutal, none)
- 📱 Full mobile support with touch optimizations
- 💾 Export functionality (single file or all styles)
- ⚙️ Configurable settings (style, auto-preview, render delay)
- 🎯 Command palette integration
- 🎭 Quick style switching via badge
- 📋 Copy to clipboard support
- ⚡ Debounced rendering for performance
Made with ❤️ for the Obsidian community