Skip to content

pardnchiu/NanoMD

Repository files navigation

Note

This README was generated by SKILL, get the ZH version from here.

cover

NanoMD

npm jsdeliver

A lightweight Markdown editing, previewing, and parsing library built on pure JavaScript and native APIs, embeddable in any webpage without framework dependencies.

Table of Contents

Features

npm i @pardnchiu/nanomd · Documentation

Real-Time Editing with Split-Screen Preview

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.

Zero-Dependency Lightweight Design

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.

Comprehensive Markdown Syntax Parsing

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.

Architecture

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]
Loading

File Structure

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

License

This project is licensed under a custom License Agreement.

Author

邱敬幃 Pardn Chiu

Stars

Star


©️ 2024 邱敬幃 Pardn Chiu