ghostwriter is a cross-platform desktop Markdown editor (Qt/C++) focused on distraction-free writing. In production, it provides a rich editing experience with live HTML preview, syntax highlighting for GitHub-Flavored Markdown (via cmark-gfm), LaTeX math rendering (via bundled MathJax), customizable themes, spell checking via KDE Sonnet, find/replace with regex support, document statistics (word count, readability indices, session analytics), and export to HTML, PDF, ODT, EPUB, and LaTeX using external tools like Pandoc or MultiMarkdown. The architecture is a standard Qt desktop application with singleton services (ExporterFactory, AppSettings, CmarkGfmAPI), a factory pattern for exporters, and a signal/slot-driven UI. Key entry points are the MainWindow (orchestrating editor, preview, sidebar, and menus), MarkdownEditor (custom QPlainTextEdit with overridden painting and input handling), and HtmlPreview (QWebEngineView with a QWebChannel bridge for live updates). Data flows: user types Markdown → MarkdownDocument (wraps cmark-gfm AST) → syntax highlighter updates → preview regenerates HTML via exporter → MathJax renders any LaTeX in the preview. External dependencies include Qt (5 or 6), KDE Frameworks (Sonnet, KConfigWidgets, KCoreAddons), and the bundled cmark-gfm and MathJax libraries. Export optionally depends on Pandoc, MultiMarkdown, or cmark command-line tools. The codebase demonstrates solid software engineering practices: clean separation of concerns, use of design patterns (singleton, factory, decorator, proxy), and extensive use of Qt's meta-object system for decoupled communication.