MCPSERV.CLUB
Writing

Writing

Self-Hosted

Distraction‑free Markdown editor with instant MathJax rendering

Stale(60)
1.1kstars
0views
Updated Aug 10, 2022
Writing screenshot

Overview

Discover what makes Writing powerful

**Writing** is a single‑page, client‑side Markdown editor designed for speed and minimalism. From a developer’s standpoint it is essentially a static bundle of HTML, CSS, and JavaScript that runs entirely in the browser. The core rendering engine is a forked version of *Pagedown* (the original Markdown parser used by StackEdit) with additional patches to support MathJax, custom keyboard shortcuts, and a distraction‑free UI. Because there is no server component, the application can be deployed as a static asset on any web host, CDN, or even served from local files (`index.html`) for offline use.

Language & Runtime

Rendering Pipeline

Styling

Dependencies

Overview

Writing is a single‑page, client‑side Markdown editor designed for speed and minimalism. From a developer’s standpoint it is essentially a static bundle of HTML, CSS, and JavaScript that runs entirely in the browser. The core rendering engine is a forked version of Pagedown (the original Markdown parser used by StackEdit) with additional patches to support MathJax, custom keyboard shortcuts, and a distraction‑free UI. Because there is no server component, the application can be deployed as a static asset on any web host, CDN, or even served from local files (index.html) for offline use.

Architecture

  • Language & Runtime: Pure JavaScript (ES5‑compatible) with no transpilation required. The code base is ~15 KB minified, making it lightweight for both users and developers.
  • Rendering Pipeline: Markdown → Pagedown → HTML → MathJax (for LaTeX). The pipeline is synchronous, which eliminates the 1‑second lag seen in some online editors.
  • Styling: CSS is scoped to the editor container, using a custom Computer‑Modern Unicode font for math and code blocks. Dark mode is toggled via CSS variables.
  • Dependencies:
    • Pagedown (core Markdown parsing)
    • Pagedown Extra (extended syntax such as tables and footnotes)
    • MathJax (client‑side LaTeX rendering)
    • A small fork of StackOverflow’s editor code for keybindings
  • File System Interaction: Uses the File API (download attribute) to allow CTRL+S saving of Markdown and PDF export via the browser’s print dialog.

Core Capabilities

FeatureTechnical Detail
Live PreviewSynchronous rendering; no debounce delay.
Keyboard ShortcutsCustom keydown listeners provide commands such as CTRL+S, CTRL+D, and LaTeX toggles.
PDF ExportLeverages the browser’s native print‑to‑PDF, no server conversion.
Math RenderingMathJax is loaded lazily only when LaTeX mode is enabled, reducing initial bundle size.
Cross‑BrowserTested on Chrome, Firefox, Safari, Edge; relies only on standard Web APIs.

Deployment & Infrastructure

Because Writing is a static asset, deployment can be as simple as uploading index.html, style.css, and the bundled JS to any static host (GitHub Pages, Netlify, Vercel, or a local Nginx server). For containerized environments, a minimal Docker image can serve the static files:

FROM nginx:alpine
COPY ./public /usr/share/nginx/html

Scaling is trivial—each instance is stateless, so load balancing or CDN caching yields instant global availability. No database or authentication layer is required, which simplifies DevOps and reduces attack surface.

Integration & Extensibility

  • Plugin Hooks: The editor exposes a global Writing object with methods to register custom commands or modify the Markdown parser. Developers can inject additional syntax extensions (e.g., mermaid diagrams) by hooking into the rendering pipeline.
  • Webhooks: While not built-in, the static nature allows integration with external services via client‑side fetch calls (e.g., auto‑saving to GitHub Gist or a custom API).
  • Customization: CSS variables and the style.css file can be overridden to change themes, fonts, or layout. The keybinding map is also exposed for custom shortcuts.

Developer Experience

  • Documentation: A concise README covers installation, usage, and keybindings. The code is heavily commented, making it approachable for contributors.
  • Community: Hosted on GitHub with an active issue tracker. The MIT license encourages reuse and modification.
  • Testing: No formal test suite, but the lightweight nature allows quick manual testing. Developers can add unit tests around the Pagedown parser if needed.

Use Cases

  1. Educational Platforms – Embed Writing in LMS or documentation sites to provide students with a fast, math‑friendly Markdown editor without server overhead.
  2. Static Site Generators – Use Writing as a preview tool during local development, then export PDFs for academic papers or reports.
  3. Offline Documentation – Distribute a self‑contained index.html for field workers who need to edit notes without internet access.
  4. Minimalist Blogging – Combine Writing with a static site generator (e.g., Jekyll) for quick content creation and preview.

Advantages

  • Zero Server Footprint: Eliminates backend maintenance, database costs, and security concerns.
  • Performance: Synchronous rendering removes latency; MathJax loads only when necessary.
  • Flexibility: Open‑source with permissive MIT license, allowing modification for niche requirements.
  • Extensibility: Hookable API and lightweight dependency set make it easy to add features or integrate with other JavaScript libraries.

In summary, Writing offers developers a plug‑and‑play Markdown editor that balances speed, minimalism, and extensibility. Its static architecture makes it ideal for environments where simplicity and offline capability are paramount, while still providing the rich features—live preview, LaTeX support, and PDF export—that modern developers expect.

Open SourceReady to get started?

Join the community and start self-hosting Writing today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
other
License
MIT
Stars
1.1k
Technical Specs
Pricing
Open Source
Database
None
Docker
None
Supported OS
LinuxWindowsmacOS
Author
josephernest
josephernest
Last Updated
Aug 10, 2022