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.
This repository is a collection of web demos and examples for MathJax version 4, the JavaScript math rendering library. It demonstrates various ways to integrate MathJax into web pages, including standard TeX/MathML input with CHTML/SVG output, equation numbering and referencing, interactive reveal/toggle steps, speech generation, and compatibility with MathJax v2 configurations. The repo also contains a substantial custom font extension named 'mathjax-newcm' (New Computer Modern) that provides extensive glyph metrics and SVG path data for mathematical typesetting, with a specific focus on braille output (the 'euro-braille' subdirectory). This font data is split into dynamic chunks loaded on demand by MathJax. The codebase is primarily illustrativeβeach demo is a self-contained HTML page with accompanying JavaScript. The custom component and TeX extension examples show how to build tailored MathJax bundles using internal APIs. The configuration converter is a standalone utility that parses legacy MathJax v2 configuration objects and generates equivalent v4 configuration. While the demos are functional and well-organized, the font data files are minified/generated artifacts that are difficult to maintain manually, and several parts rely on MathJax internal APIs that may change across versions. The euro-braille and euro-braille-old directories contain near-duplicate font data with version drift, indicating a maintenance challenge. Overall, this repo serves as a practical reference for MathJax v4 integration patterns and custom font development, but it is not a production library itself. The most reusable components are the custom component assembly pattern, the TeX extension template, and the configuration converter utility.