Skip to content

raselrahmanrocky/Rmilk

Repository files navigation

A Next.js powered Markdown editor with LaTeX, Mermaid diagrams, and DOCX export support.

Features

  • Live Preview - Real-time markdown preview alongside your editor
  • GitHub Flavored Markdown - Full GFM support with tables, task lists, strikethrough
  • LaTeX Math - Inline ($...$) and block ($$...$$) math equations
  • Mermaid Diagrams - Flowcharts, sequence diagrams, class diagrams
  • Syntax Highlighting - Code blocks with language detection
  • DOCX Export - Export your document to Microsoft Word format
  • Bengali/Unicode Support - Full support for Bengali text with Bornomala font
  • Paragraph & Line Break Control - Precise control over line breaks and spacing

Quick Start

Prerequisites

  • Node.js 18+

Installation

pnpm install

Development

pnpm dev

Open http://localhost:3000 in your browser.

Production Build

pnpm build
pnpm start

Editor Features

Line Break Behavior

The editor follows these rules for rendering line breaks:

Input Description Rendered As
Single Enter Line break within paragraph <br> (soft return)
Double Enter New paragraph Empty line with spacing
Empty Line Blank spacer Visible empty line

Supported Syntax

Text Formatting

  • Bold - **text**
  • Italic - *text*
  • Strikethrough - ~~text~~
  • Code - `code`

Headings

# Heading 1
## Heading 2
### Heading 3

Lists

Unordered:

- Item 1
- Item 2
  - Nested item

Ordered:

1. First
2. Second
3. Third

Code Blocks

```javascript
function hello() {
  console.log('Hello!');
}
```

LaTeX Math

Inline: $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$

Block:

$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$

Tables

| Header 1 | Header 2 |
|----------|----------|
| Cell 1   | Cell 2   |

Mermaid Diagrams

```mermaid
graph TD
    A --> B
```

Toolbar Actions

Button Action
🗑️ Clear all content
🔄 Reset to default
📋 Copy to clipboard
📤 Upload markdown file
💾 Save as .md
📥 Download markdown
📄 Export to DOCX
Toggle fullscreen

DOCX Export

The export feature converts your markdown to a Word document with:

  • Font: Bornomala (configurable)
  • Font Size: 12pt
  • Line Height: 1.0
  • Paragraph Spacing: 0pt before/after
  • Preserved Formatting:
    • Headings (H1-H6)
    • Bold and italic text
    • Lists (ordered & unordered)
    • Tables
    • Code blocks
    • Math equations

Project Structure

rmilk/
├── app/
│   ├── api/export/docx/
│   │   └── route.ts          # DOCX export API
│   ├── globals.css           # Global styles
│   ├── layout.tsx            # App layout
│   └── page.tsx              # Main page
├── src/
│   ├── App.tsx               # Main app component
│   ├── components/
│   │   ├── MarkdownEditor.tsx
│   │   ├── MarkdownPreview.tsx
│   │   ├── StatusBar.tsx
│   │   └── Toolbar.tsx
│   └── lib/
│       ├── api/
│       │   └── docxLib.ts    # DOCX utilities
│       ├── defaultContent.ts # Sample content
│       └── markdownFormatter.ts
├── package.json
└── README.md

Technologies

  • Framework: Next.js 16 with Turbopack
  • UI: React 19
  • Styling: Tailwind CSS
  • Markdown: React Markdown + remark/rehype plugins
  • Math: KaTeX + remark-math
  • Diagrams: Mermaid
  • DOCX: mdast2docx + docx library
  • Icons: Lucide React

License

MIT

About

Rmilk: A feature-rich Markdown Editor built with Next.js. A modern writing tool featuring real-time preview, LaTeX math support, Mermaid diagrams, and seamless DOCX export. Designed for developers and writers who need a fast, clean, and flexible Markdown environment.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors