A lightweight Markdown editing, previewing, and parsing library built on pure JavaScript and native APIs, embeddable in any webpage without framework dependencies.
npm i @pardnchiu/nanomd· Documentation
NanoMD includes a full-featured Markdown editor with live rendering and split-screen preview, enabling simultaneous writing and viewing. The editor provides undo/redo, keyboard shortcuts, and auto-indentation without requiring mode switching to verify the final output.
Built entirely on native JavaScript and DOM APIs with no framework dependencies such as React or Vue. The minified bundle is extremely compact and can be imported into any web project via CDN or npm, minimizing integration cost and load overhead.
Supports headings, bold, italic, code blocks, tables, lists, blockquotes, image/video embeds, and Mermaid diagrams. Also provides hashtag linking, syntax highlighting, and file export (Markdown / HTML) as advanced features.
graph LR
A[MDEditor] -->|text| B[MDParser]
B -->|HTML| C[MDViewer]
A -->|sync| C
D[User Input] --> A
C --> E[Live Preview]
A -->|export| F[Markdown / HTML]
NanoMD/
├── dist/
│ ├── NanoMD.js # Minified build
│ ├── NanoMD.esm.js # ESM module
│ └── NanoMD.css # Stylesheet
├── src/
│ ├── data.js # Constants and configuration
│ ├── function/ # Parsing utilities
│ └── model/ # Core classes
│ ├── editor.js # MDEditor
│ ├── viewer.js # MDViewer
│ └── parser.js # MDParser
├── static/ # Website assets
├── page/ # Documentation pages
├── package.json
└── LICENSE
This project is licensed under a custom License Agreement.
©️ 2024 邱敬幃 Pardn Chiu
