Repository navigation
Add open-source Markdown to PDF editor - #1
Merged
Merged
Conversation
Add the Markdown pipeline (unified/remark/rehype, highlight.js), PDF engine (puppeteer-core, @sparticuz/chromium), zustand, lucide-react, and optional Supabase libraries. Configure Turbopack root, mark the headless browser packages as server-external, and ignore the generated CSS module in ESLint.
A single unified pipeline renders Markdown to sanitized HTML for both the live preview and the PDF, guaranteeing they match. The headless browser launcher auto-detects a system Chrome locally and uses @sparticuz/chromium on serverless. PDF stylesheets are vendored into a generated module (scripts/gen-css.mjs) so they bundle reliably.
POST /api/pdf validates and sanitizes the request, renders the Markdown, and returns a PDF with configurable page size and margins. Caps payload size and sanitizes the download filename.
A readme.so-style editor: Markdown source with a formatting toolbar on one side, live preview on the other. Side-by-side on desktop, with a Write/Preview tab toggle and a settings popover below lg. Includes templates, localStorage autosave, a status bar, page metadata, and a teal design system.
Client/server Supabase helpers that no-op without env keys, plus a documents table with row-level security. The core tool works fully without any of this; it only adds optional accounts and cloud sync.
README with quick start and architecture, PLAN.md with the phased rollout plan and the rationale for staying lean instead of starting from a full SaaS boilerplate, CONTRIBUTING guide, and MIT license.
Run lint and build on pushes to main and on pull requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Open-source Markdown → PDF tool — an alternative to markdowntopdf.com with a readme.so-style split editor. Write Markdown with a live preview and download a polished, vector-quality PDF. No sign-up required.
What's included
lg./api/pdfrenders via headless Chrome (system Chrome locally,@sparticuz/chromiumon serverless). Real vector text, syntax highlighting, GitHub-style typography, configurable page size + margins.unified(remark/rehype) render + CSS drives both the preview and the PDF, so the download always matches the screen. Output is sanitized viarehype-sanitize.documentstable with RLS, inert until env keys are set. The core tool works with zero config.PLAN.md(phased rollout + rationale for staying lean vs. a full SaaS boilerplate), CONTRIBUTING, MIT license, and CI (lint + build).Tech
Next.js 16 (App Router) · React 19 · Tailwind v4 · zustand · puppeteer-core.
Verification
npm run lintandnpm run buildpass.Commits
Landed as seven small, focused commits (deps/config, render+PDF engine, API route, editor UI, Supabase scaffold, docs, CI).