mdoipk
v1.1.0
Published
A lightweight Markdown viewer & editor with real-time preview, served locally in your browser
Maintainers
Readme
mdoipk
Markdown viewer & editor with real-time preview in your browser.
Features
- Split-pane editor (CodeMirror 6) + live preview
- Syntax highlighting for fenced code blocks (highlight.js, 190+ languages)
- File watcher — external changes reflect in the browser instantly
- Drag the divider to resize panes; cycle through Split / Editor-only / Preview-only layouts
Ctrl+S/Cmd+Sto save- View-only mode (
mdoipk <file>) and editor mode (mdoipk edit <file>) - Dark theme, zero config, works offline
Install
npm install -g mdoipkUsage
# View-only preview (read the file, watch for external changes)
mdoipk README.md
# Full editor with live preview
mdoipk edit README.md
# Create a new file
mdoipk edit notes.md
# Scratch pad (no file, in-memory only)
mdoipk edit
# Custom port
mdoipk edit README.md -p 4000
# Skip auto-opening browser
mdoipk README.md --no-openProgrammatic API
const { startServer, renderMarkdown } = require('mdoipk');
// Start the server
startServer({ filePath: '/path/to/file.md', port: 3399, autoOpen: true, mode: 'edit' });
// Render Markdown to HTML string
const html = renderMarkdown('# Hello **world**');Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+S / Cmd+S | Save file |
| Tab | Indent |
| Ctrl+Z / Cmd+Z | Undo |
| Ctrl+Shift+Z | Redo |
License
MIT
mdoipk(中文说明)
Markdown 查看与实时编辑器,运行于本地浏览器。
功能
- 左侧 CodeMirror 6 编辑,右侧实时预览
- 代码块语法高亮(highlight.js,支持 190+ 语言)
- 文件监听,外部修改自动刷新预览
- 拖动分隔线调整宽度,一键切换 分屏/仅编辑/仅预览
Ctrl+S保存文件- 只读预览模式(
mdoipk <file>)和完整编辑模式(mdoipk edit <file>) - 深色主题,无需配置,离线可用
安装
npm install -g mdoipk使用
# 只读预览(外部修改自动同步)
mdoipk README.md
# 完整编辑器
mdoipk edit README.md
# 暂存区(不绑定文件)
mdoipk edit
# 自定义端口
mdoipk edit README.md -p 4000License
MIT
