Skip to content

vincenthopf/mdrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mDrop

mDrop

One command. Instant page.
Turn any markdown file into a beautifully styled, shareable webpage.

MIT License npm version

mDrop transforms markdown into styled webpages


What is mDrop?

mDrop is a CLI tool that takes a markdown file, renders it as a beautifully styled HTML page, and gives you a shareable URL — all in one command.

$ mdrop README.md --theme brutalist Rendering with brutalist theme... Uploading... https://mdrop.workers.dev/a1b2c3d4
  • Pre-rendered HTML — All rendering happens locally. Pages load instantly.
  • 5 built-in themes — Clean, Brutalist, Terminal, Academic, Playful.
  • Configurable expiry — Links expire in 1h, 7d, 30d, or never.
  • Self-hosted — Runs on your own Cloudflare Workers account. Free tier. $0.
  • Open source — MIT licensed. Fork it, extend it, own it.

Quick Start

1. Deploy the Worker (one click)

Click the button. Cloudflare handles everything — clones the repo, creates KV storage, and prompts you for your API key. All in one flow.

Deploy to Cloudflare Workers

You'll be asked to:

  • Choose a Worker name (or keep the default mdrop)
  • Set your API_KEY secret — pick any strong string, you'll use it in step 3

That's it. Your Worker is live.

2. Install the CLI

npm install -g mdrop

3. Connect

mdrop init # Paste your Worker URL (shown after deploy) and the API key you chose

4. Drop it

mdrop file.md # Clean theme, 7-day expiry mdrop file.md --theme brutalist # Choose a theme mdrop file.md --expires 30d # Set link expiry mdrop file.md --expires never # Permanent link

Custom Domain (optional)

Want your pages at share.yourdomain.com instead of mdrop.workers.dev? If your domain is on Cloudflare:

  1. Go to Workers & Pages → your mDrop Worker → Settings → Domains & Routes
  2. Click Add → Custom Domain
  3. Enter your subdomain (e.g., share.yourdomain.com)

Cloudflare handles DNS and SSL automatically. Then run mdrop init again with your new domain.

Themes

Choose a theme with --theme <name>. Every page is fully self-contained — CSS inlined, zero external requests.

mDrop themes: Clean, Brutalist, Terminal, Academic, Playful

Theme Flag Description
Clean --theme clean Sans-serif, minimal, light/dark mode. The default.
Brutalist --theme brutalist Monospace, hard borders, offset shadows. Neo-brutalist.
Terminal --theme terminal Green on black, scanlines. Hacker aesthetic.
Academic --theme academic Serif fonts, paper background. LaTeX-inspired.
Playful --theme playful Rounded, colorful, friendly.

Commands

Command Description
mdrop <file> Share a markdown file
mdrop init Configure Worker URL and API key
mdrop list List your shared pages
mdrop delete <id> Delete a shared page
mdrop preview <file> Preview locally before sharing
mdrop --help Show help

Flags

Flag Short Default Description
--theme -t clean Theme name
--expires -e 7d Link expiry (1h, 7d, 30d, never)

Architecture

mDrop architecture overview

mDrop is two things:

  1. CLI (Node.js) — Parses markdown with markdown-it, highlights code with Shiki, wraps in themed HTML, uploads.
  2. Worker (~50 lines of JS) — Stores HTML in Cloudflare KV, serves it. That's it.

All rendering happens on your machine. The Worker is a trivial static file server. Deploy it once, push content forever — no rebuilds.

mDrop data flow: CLI → Worker → KV → Browser

Tech Stack

Component Choice
Markdown parser markdown-it
Syntax highlighting Shiki (inline styles, VS Code accuracy)
TOC generation markdown-it-anchor + markdown-it-toc-done-right
Hosting Cloudflare Workers + KV
Link expiry Native KV TTL (no cleanup logic)

Free Tier Limits

Resource Limit
Worker requests 100,000/day
KV reads 100,000/day
KV writes 1,000/day
KV storage 1 GB

Manual Deploy

If you prefer manual setup over the deploy button:

wrangler login git clone https://github.com/vincenthopf/mdrop cd mdrop/worker wrangler kv namespace create "PAGES" # Replace the id in wrangler.toml with the namespace ID from the output wrangler secret put API_KEY wrangler deploy

Project Structure

mdrop/ ├── cli/ # CLI tool │ ├── bin/mdrop.js # Entry point │ ├── src/ │ │ ├── index.js # Arg parsing, commands │ │ ├── render.js # markdown-it + shiki pipeline │ │ ├── template.js # HTML wrapper │ │ ├── upload.js # Worker API client │ │ ├── config.js # ~/.config/mdrop/config.json │ │ └── themes/ # 5 CSS themes │ └── package.json ├── worker/ # Cloudflare Worker │ ├── src/index.js # ~50 lines: POST/GET/DELETE/LIST │ ├── wrangler.toml │ └── package.json └── site/ # Landing page (Astro) 

Contributing

Contributions welcome. Please open an issue first to discuss what you'd like to change.

License

MIT

About

One command. Instant page. Share markdown files as styled HTML pages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors