Skip to content

pal815/md-editor

Repository files navigation

md-editor

English | 한국어

A fast, local-first Markdown editor for the desktop, built with Tauri 2, SvelteKit, and CodeMirror 6. It edits files directly on disk, opens multiple documents in tabs, restores your session on the next launch, and ships as a small native Windows installer.

Made for Markdown beginners. You don't need to memorize Markdown syntax — format headings, tables, bold/italic, lists, links, and code blocks from the right-click menu or with familiar shortcuts (Ctrl+B, Ctrl+I, …), and switch to a clean rendered preview with Ctrl+E to see how it looks.

Status: early (0.1.x). Windows is the primary target; the codebase is cross-platform but only Windows installers are produced today.

Features

  • Live-preview editing — headings, emphasis, lists, and code render inline while you keep the raw Markdown editable.
  • Real tables — Markdown pipe tables are rendered as actual tables. Type a header row and press Enter to auto-complete the alignment row; typing | adds a column to every row at once. Right-click a cell to insert/delete rows and columns, or copy the table as TSV (Excel) / HTML.
  • Viewer mode (Ctrl+E) — a rendered, read-only view with syntax-highlighted code blocks and clickable bare URLs. External images are blocked by default and can be enabled from the View menu.
  • Tabs & session restore — open many files at once; unsaved buffers are restored automatically when you reopen the app.
  • Drag-and-drop & file association — drop .md files onto the window, or set md-editor as the default app so double-clicking a .md opens it (each file in its own tab; a single running instance is reused).
  • Light / Dark / Follow-System themes — switch from the View menu; the choice is remembered.
  • Code-fence highlighting — JavaScript, TypeScript, Python, SQL, JSON, HTML, CSS, Rust, YAML, Markdown, and more.
  • Math & diagrams (Viewer) — fenced ```latex (or ```math) blocks render as LaTeX via KaTeX, and ```mermaid blocks render as diagrams.

Keyboard shortcuts

Shortcut Action
Ctrl+N / O / S New / Open / Save
Ctrl+Shift+S Save As
Ctrl+T / W New tab / Close tab
Ctrl+Tab, Ctrl+19 Switch tabs
Ctrl+B / I / ` Bold / Italic / Inline code
Ctrl+K Insert link
Ctrl+E Toggle Edit / Viewer
Ctrl+= / - / 0 Zoom in / out / reset
Enter (in a table cell) In-cell line break (<br>)
Enter (end of a table row) Add a new row
Ctrl+Enter (in a table) Exit the table onto a new line

Right-click inside the editor for headings, table operations, lists, blockquotes, links, code blocks, and more.

Install (Windows)

Grab an installer from the Releases page:

  • md-editor_x.y.z_x64-setup.exe (NSIS) — recommended; per-user install, no admin prompt.
  • md-editor_x.y.z_x64_en-US.msi (MSI) — for group-policy / MDM deployment.

File association (opt-in). The installer does not touch your file associations. To register md-editor as a Markdown handler, use the in-app menu File → Set as .md Handler… — this adds a per-user entry (under HKCU, no admin rights) for .md, .markdown, .mdown, and .mkd, so md-editor shows up in the Open with list. File → Remove .md Handler reverts it.

To make it the default app after registering: right-click any .md file → Open withChoose another appmd-editor → check Always. (Windows requires this one-time user confirmation — apps cannot silently seize the default handler on modern Windows.)

Build from source

Prerequisites

  • Node.js 18+ and pnpm
  • Rust (stable)
  • Tauri prerequisites for your OS — see the Tauri guide. On Windows this means the WebView2 runtime and the MSVC build tools.

Develop

pnpm install
pnpm tauri dev

Produce installers

pnpm tauri build

Artifacts are written to src-tauri/target/release/ (portable .exe) and src-tauri/target/release/bundle/ (MSI + NSIS).

Type-check

pnpm run check          # Svelte / TypeScript
cargo check             # run inside src-tauri/

Security notes

md-editor is local-first and makes no network requests of its own.

  • The Rust backend only reads/writes files the user explicitly picked (via the native dialog, drag-and-drop, file association, or restored session). A server-side approve-list prevents a compromised renderer from reading arbitrary paths; UNC/network paths, NTFS alternate data streams, and system directories are rejected, and file operations are capped at 64 MB.
  • A strict Content-Security-Policy is applied (default-src 'self', object-src 'none', no inline scripts).
  • Viewer-mode HTML is sanitized with DOMPurify; external images are off by default.

Tech stack

Tauri 2 · SvelteKit (adapter-static) · Svelte 5 (runes) · TypeScript · CodeMirror 6 · @lezer/markdown · pulldown-cmark · highlight.js · DOMPurify

Acknowledgements

This project was developed with the assistance of Claude Code (Anthropic) and Codex (OpenAI), used for implementation, code review, and cross-verification throughout development.

License

MIT © 2026 pal815

This project bundles third-party open-source components (all permissively licensed). Their notices are collected in THIRD-PARTY-LICENSES.md.


한국어

English | 한국어

Tauri 2, SvelteKit, CodeMirror 6로 만든 로컬 우선(local-first) 데스크톱 마크다운 에디터입니다. 파일을 디스크에서 직접 편집하고, 여러 문서를 탭으로 열며, 다음 실행 시 세션을 복원하고, 가벼운 Windows 네이티브 설치 파일로 배포됩니다.

마크다운 입문자를 위해 만들었습니다. 마크다운 문법을 외울 필요가 없습니다 — 제목, 표, 굵게/기울임, 목록, 링크, 코드 블록을 우클릭 메뉴나 익숙한 단축키 (Ctrl+B, Ctrl+I 등)로 적용하고, Ctrl+E로 깔끔하게 렌더링된 미리보기를 보며 결과를 확인할 수 있습니다.

상태: 초기 버전(0.1.x). 주 대상은 Windows이며, 코드베이스는 크로스플랫폼이지만 현재는 Windows 설치 파일만 빌드합니다.

주요 기능

  • 라이브 프리뷰 편집 — 제목·강조·목록·코드가 인라인으로 렌더링되면서도 원본 마크다운은 그대로 편집할 수 있습니다.
  • 실제 표 렌더링 — 마크다운 파이프 표를 진짜 표 모양으로 보여줍니다. 헤더 행을 입력하고 Enter를 누르면 정렬 행이 자동 완성되고, |를 입력하면 모든 행에 동시에 열이 추가됩니다. 셀을 우클릭해 행/열을 추가·삭제하거나 표를 TSV(엑셀) / HTML 로 복사할 수 있습니다.
  • 뷰어 모드 (Ctrl+E) — 코드 블록 구문 강조와 클릭 가능한 평문 URL이 적용된 읽기 전용 렌더링 화면입니다. 외부 이미지는 기본 차단이며 View 메뉴에서 허용할 수 있습니다.
  • 탭 & 세션 복원 — 여러 파일을 동시에 열 수 있고, 저장하지 않은 내용도 앱을 다시 열면 자동으로 복원됩니다.
  • 드래그 앤 드롭 & 파일 연결.md 파일을 창에 끌어다 놓거나, md-editor를 기본 앱으로 지정해 .md 더블클릭으로 열 수 있습니다(각 파일이 별도 탭으로 열리고, 실행 중인 인스턴스를 재사용합니다).
  • 라이트 / 다크 / 시스템 따름 테마 — View 메뉴에서 전환하며, 선택은 기억됩니다.
  • 코드 펜스 구문 강조 — JavaScript, TypeScript, Python, SQL, JSON, HTML, CSS, Rust, YAML, Markdown 등.
  • 수식 & 다이어그램 (뷰어)```latex (또는 ```math) 코드 블록은 KaTeX로 LaTeX 수식으로, ```mermaid 블록은 다이어그램으로 렌더링됩니다.

단축키

단축키 동작
Ctrl+N / O / S 새 문서 / 열기 / 저장
Ctrl+Shift+S 다른 이름으로 저장
Ctrl+T / W 새 탭 / 탭 닫기
Ctrl+Tab, Ctrl+19 탭 전환
Ctrl+B / I / ` 굵게 / 기울임 / 인라인 코드
Ctrl+K 링크 삽입
Ctrl+E 편집 / 뷰어 전환
Ctrl+= / - / 0 확대 / 축소 / 원래대로
Enter (표 셀 안) 셀 내 줄바꿈 (<br>)
Enter (표 행 끝) 새 행 추가
Ctrl+Enter (표 안) 표를 끝내고 다음 줄로

편집 영역을 우클릭하면 제목, 표 조작, 목록, 인용, 링크, 코드 블록 등의 메뉴가 나옵니다.

설치 (Windows)

Releases 페이지에서 설치 파일을 받으세요:

  • md-editor_x.y.z_x64-setup.exe (NSIS) — 권장. 사용자 단위 설치이며 관리자 권한 프롬프트가 없습니다.
  • md-editor_x.y.z_x64_en-US.msi (MSI) — 그룹 정책 / MDM 배포용.

파일 연결 (선택). 설치 프로그램은 파일 연결을 건드리지 않습니다. md-editor를 마크다운 처리기로 등록하려면 앱 메뉴 File → Set as .md Handler… 를 사용하세요 — 관리자 권한 없이 사용자 레지스트리(HKCU)에 .md, .markdown, .mdown, .mkd 항목을 추가하여 연결 프로그램 목록에 md-editor가 나타나게 합니다. File → Remove .md Handler 로 해제합니다.

등록 후 기본 앱으로 지정하려면: .md 파일 우클릭 → 연결 프로그램다른 앱 선택md-editor항상 체크. (최신 Windows는 앱이 기본 앱을 임의로 가로채는 것을 막으므로, 이 한 번의 사용자 확인이 필요합니다.)

소스에서 빌드

사전 요구사항

  • Node.js 18+ 와 pnpm
  • Rust (stable)
  • OS별 Tauri 사전 요구사항 — Tauri 가이드 참고. Windows에서는 WebView2 런타임MSVC 빌드 도구가 필요합니다.

개발 실행

pnpm install
pnpm tauri dev

설치 파일 생성

pnpm tauri build

산출물은 src-tauri/target/release/(포터블 .exe)와 src-tauri/target/release/bundle/(MSI + NSIS)에 생성됩니다.

타입 검사

pnpm run check          # Svelte / TypeScript
cargo check             # src-tauri/ 안에서 실행

보안 참고

md-editor는 로컬 우선이며 자체적으로 네트워크 요청을 하지 않습니다.

  • Rust 백엔드는 사용자가 명시적으로 고른 파일만 읽고 씁니다(네이티브 대화상자, 드래그 앤 드롭, 파일 연결, 복원된 세션 경유). 서버 측 승인 목록(approve-list) 으로 손상된 렌더러가 임의 경로를 읽지 못하게 막고, UNC/네트워크 경로·NTFS 대체 데이터 스트림·시스템 디렉터리는 거부하며, 파일 작업은 64 MB로 제한됩니다.
  • 엄격한 콘텐츠 보안 정책(CSP)을 적용합니다(default-src 'self', object-src 'none', 인라인 스크립트 금지).
  • 뷰어 모드의 HTML은 DOMPurify로 정화하며, 외부 이미지는 기본적으로 꺼져 있습니다.

기술 스택

Tauri 2 · SvelteKit (adapter-static) · Svelte 5 (runes) · TypeScript · CodeMirror 6 · @lezer/markdown · pulldown-cmark · highlight.js · DOMPurify

개발 도구 / 감사의 글

이 프로젝트는 Claude Code(Anthropic)와 Codex(OpenAI)의 도움을 받아 개발되었습니다. 구현, 코드 리뷰, 교차 검증 전반에 두 도구를 활용했습니다.

라이선스

MIT © 2026 pal815

이 프로젝트는 제3자 오픈소스 구성요소(모두 허용형 라이선스)를 포함합니다. 관련 고지는 THIRD-PARTY-LICENSES.md에 모았습니다.

About

A local-first desktop Markdown editor for beginners — Tauri 2 + SvelteKit + CodeMirror 6

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors