Skip to content

raymindai/mdcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

355 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mdcore

The fastest way from thought to shared document.

Import anything. Render beautifully. Share instantly. Powered by Rust + WASM.

                    mdcore engine (Rust)
                           β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚              β”‚              β”‚
         WASM           napi-rs        native
            β”‚              β”‚              β”‚
       β”Œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”Όβ”€β”€β”€β”€β”
    Browser Edge  Deno Node Raycast  CLI  Mobile
    mdfy.cc  CF         npm  Obsidian  brew  iOS
             Workers    pkg  VS Code   install Android

What is this?

mdcore is a Markdown parsing, rendering, and conversion engine built in Rust. The web product mdfy.cc is the first surface built on top of the engine.

mdfy.cc is not just a renderer β€” it’s a full document platform:

  • Import any file format (PDF, DOCX, PPTX, XLSX, HTML, CSV, LaTeX, and more)
  • Edit inline with WYSIWYG or source Markdown
  • AI mdfy β€” AI-powered structuring turns raw text into clean Markdown
  • Share with a single click β€” short URL with beautiful rendered output
  • Export to MD, HTML, TXT, PDF, or copy as rich text for Docs/Email/Slack

Features

Editor

  • WYSIWYG editing β€” edit directly in the rendered preview like a word processor
  • Source editing β€” CodeMirror 6 with Markdown-aware highlighting
  • Split view β€” side-by-side Beautified + MDFIED (source) panels
  • Floating toolbar β€” context-aware formatting on text selection
  • Narrow view β€” constrain content width for comfortable reading

Import (13 formats)

  • Documents β€” MD, PDF, DOCX, PPTX, XLSX, HTML, RTF
  • Data β€” CSV, JSON, XML
  • Academic β€” LaTeX, RST (reStructuredText)
  • Plain text β€” TXT
  • CLI output β€” auto-detects Claude Code / terminal output (unicode tables, checkmarks)
  • AI mdfy β€” post-import AI structuring via Gemini

Export

  • Download β€” Markdown, HTML, Plain Text
  • Print β€” PDF via browser print
  • Clipboard β€” Raw HTML, Rich Text (Google Docs/Email), Slack mrkdwn, Plain Text
  • Share β€” Short URL, QR Code, Embed code (iframe)

Rendering

  • Full GFM β€” tables, task lists, footnotes, strikethrough, autolinks
  • Math β€” KaTeX for inline and display equations
  • Mermaid β€” flowcharts, sequence diagrams, gantt charts
  • 190+ languages β€” syntax highlighting via highlight.js
  • Flavor detection β€” auto-detects GFM, Obsidian, MDX, Pandoc, CommonMark
  • Flavor conversion β€” convert between GFM, CommonMark, Obsidian with one click

Organization

  • Folders β€” create, rename, drag-and-drop documents between folders
  • Trash β€” soft delete with restore
  • Sorting β€” newest, oldest, Aβ†’Z, Zβ†’A
  • Cloud sync β€” sign in to save documents across devices

Auth & Sharing

  • Google / GitHub OAuth + Email magic link
  • Beta β€” everything unlocked while we're testing, no credit card
  • Pro tier β€” kicks in after beta: no badge, custom domain, analytics, password protection (pricing TBD)

Packages

mdcore ships five npm packages that can be used independently:

Package Description Install
@mdcore/engine Rust WASM engine + TypeScript postprocessor (highlight.js, KaTeX, Mermaid, file import) npm i @mdcore/engine
@mdcore/styles CSS-only rendering styles -- dark/light themes, document layout, print, diagrams npm i @mdcore/styles
@mdcore/api HTTP client for the mdfy.cc document API (publish, update, pull, delete, versions) npm i @mdcore/api
@mdcore/ai AI provider abstraction (Gemini, OpenAI, Anthropic) for text-to-markdown and diagram rendering npm i @mdcore/ai

The Rust engine source lives in packages/engine/ and is compiled to WASM, then wrapped by the TypeScript package in packages/mdcore/.

See docs/PACKAGES.md for the full architecture guide, dependency graph, and migration instructions.

Tech Stack

Layer Technology
Core Engine Rust + comrak
WASM wasm-bindgen + wasm-pack
Web App Next.js 15 + React 19 + TailwindCSS v4
Source Editor CodeMirror 6
Math KaTeX
Diagrams Mermaid.js
DOCX Import mammoth
Office Import officeparser (PPTX, XLSX)
PDF Import pdf-parse (server-side)
AI Structuring Gemini API
HTML β†’ MD Turndown + GFM plugin
Auth Supabase Auth (@supabase/ssr)
Database Supabase PostgreSQL
Hosting Vercel

Project Structure

mdcore/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ engine/              # Rust core engine (comrak β†’ WASM)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ lib.rs       # WASM bindings (wasm-bindgen)
β”‚   β”‚       β”œβ”€β”€ render.rs    # HTML rendering via comrak
β”‚   β”‚       └── flavor.rs    # MD flavor detection
β”‚   β”œβ”€β”€ mdcore/              # @mdcore/engine npm package (TypeScript)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ index.ts     # mdcore object + re-exports
β”‚   β”‚       β”œβ”€β”€ postprocess.ts  # highlight.js + KaTeX + ASCII diagrams
β”‚   β”‚       β”œβ”€β”€ file-import.ts  # CSV, JSON, XML, HTML, RTF, LaTeX, RST
β”‚   β”‚       β”œβ”€β”€ html-to-md.ts   # HTML β†’ Markdown (Turndown)
β”‚   β”‚       β”œβ”€β”€ cli-to-md.ts    # CLI output β†’ Markdown
β”‚   β”‚       └── mermaid-style.ts # Mermaid SVG post-processing
β”‚   β”œβ”€β”€ styles/              # @mdcore/styles (CSS-only)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ index.css    # Main entry (imports all)
β”‚   β”‚       β”œβ”€β”€ theme-dark.css   # Dark theme variables
β”‚   β”‚       β”œβ”€β”€ theme-light.css  # Light theme variables
β”‚   β”‚       β”œβ”€β”€ rendered.css # .mdcore-rendered document styles
β”‚   β”‚       β”œβ”€β”€ code.css     # highlight.js light-mode overrides
β”‚   β”‚       β”œβ”€β”€ diagram.css  # Mermaid + ASCII containers
β”‚   β”‚       └── print.css    # Print / PDF export
β”‚   β”œβ”€β”€ api/                 # @mdcore/api (HTTP client)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ client.ts    # MdfyClient class
β”‚   β”‚       β”œβ”€β”€ documents.ts # Standalone functions
β”‚   β”‚       β”œβ”€β”€ upload.ts    # Image upload
β”‚   β”‚       └── types.ts     # TypeScript interfaces
β”‚   └── ai/                  # @mdcore/ai (AI providers)
β”‚       └── src/
β”‚           β”œβ”€β”€ mdfy-text.ts     # Raw text β†’ structured Markdown
β”‚           β”œβ”€β”€ ascii-render.ts  # ASCII/Mermaid β†’ styled HTML
β”‚           β”œβ”€β”€ conversation.ts  # AI conversation detection
β”‚           └── providers/       # Gemini, OpenAI, Anthropic
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                 # Next.js 15 web app (mdfy.cc)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ app/
β”‚   β”‚       β”‚   β”œβ”€β”€ api/
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ docs/          # Document CRUD
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ import/pdf/    # PDF text extraction
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ import/office/ # PPTX/XLSX extraction
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ import/mdfy/   # AI structuring
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ user/          # User documents
β”‚   β”‚       β”‚   β”‚   └── og/            # OG image generation
β”‚   β”‚       β”‚   β”œβ”€β”€ auth/callback/     # OAuth callback
β”‚   β”‚       β”‚   β”œβ”€β”€ d/[id]/            # SSR document viewer
β”‚   β”‚       β”‚   β”œβ”€β”€ embed/[id]/        # Embed viewer
β”‚   β”‚       β”‚   └── about/             # About page
β”‚   β”‚       β”œβ”€β”€ lib/
β”‚   β”‚       β”‚   β”œβ”€β”€ engine.ts          # WASM engine wrapper
β”‚   β”‚       β”‚   β”œβ”€β”€ share.ts           # URL sharing + document API
β”‚   β”‚       β”‚   β”œβ”€β”€ useAuth.ts         # Auth hook
β”‚   β”‚       β”‚   └── supabase*.ts       # Supabase clients
β”‚   β”‚       └── components/
β”‚   β”‚           β”œβ”€β”€ MdEditor.tsx       # Main editor (WYSIWYG + Source)
β”‚   β”‚           β”œβ”€β”€ FloatingToolbar.tsx # Selection toolbar
β”‚   β”‚           β”œβ”€β”€ useCodeMirror.ts   # CM6 hook
β”‚   β”‚           β”œβ”€β”€ MdCanvas.tsx       # Mermaid visual editor
β”‚   β”‚           └── MathEditor.tsx     # KaTeX equation editor
β”‚   └── vscode-extension/   # VS Code extension
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ PACKAGES.md          # Package architecture guide
β”‚   β”œβ”€β”€ ARCHITECTURE.md      # Technical architecture decisions
β”‚   β”œβ”€β”€ ROADMAP.md           # Product roadmap
β”‚   β”œβ”€β”€ MANIFESTO.md         # Project manifesto
β”‚   └── MASTER-PLAN.md       # Master plan
└── package.json

Quick Start

Prerequisites

Run the web app

cd apps/web
npm install
npm run dev    # β†’ http://localhost:3000

Build the engine

cd packages/engine
cargo test
wasm-pack build --target bundler --out-dir ../../apps/web/src/lib/wasm --release

Environment variables

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
GEMINI_API_KEY=your-gemini-key

Keyboard Shortcuts

Shortcut Action
⌘B Bold
⌘I Italic
⌘K Insert link
⌘S Share (copy URL)
βŒ˜β‡§C Copy HTML
⌘Z Undo
βŒ˜β‡§Z Redo
⌘\ Toggle view mode
Esc Focus editor
Double-click Edit code/math/diagram/table inline

Roadmap

  • WYSIWYG editing (contentEditable on rendered HTML)
  • Multi-format import (PDF, DOCX, PPTX, XLSX, HTML, CSV, LaTeX, RST)
  • AI mdfy structuring (Gemini)
  • CLI output auto-conversion
  • Folders + Trash + Sorting
  • Auth (Google/GitHub/Email)
  • Cloud sync + document ownership
  • Viral badge (β€œPublished with mdfy.cc”)
  • Flavor conversion (GFM ↔ CommonMark ↔ Obsidian)
  • Stripe billing (Pro $8/mo)
  • Custom domains
  • View analytics
  • Chrome extension (ChatGPT/Claude β†’ mdfy.cc)
  • @mdcore/engine npm package
  • @mdcore/terminal CLI renderer
  • VS Code / Obsidian plugins
  • Mobile SDK (UniFFI β†’ Swift/Kotlin)

License

MIT


mdcore β€” The fastest way from thought to shared document.

mdfy.cc Β· mdcore.ai

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors