# schuyler/macdown3000 architecture

> Architecture diagram of the GitHub repository schuyler/macdown3000, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/schuyler/macdown3000
- Repository: https://github.com/schuyler/macdown3000

## Overview

MacDown 3000 is a macOS Markdown editor. Its primary workflow is editing Markdown, rendering it to HTML, and showing a live preview; users can also browse folders, configure editor/rendering preferences, and export HTML or PDF. The graph includes the documented highlighting and rendering extensions, plus PEG Markdown Highlight’s parser/style-parser internals and compiler support. Most application implementations are not sampled, so documented capabilities are represented without guessing their internal call wiring.

Main entry points: [`MacDown/Code/Document/MPRenderer.h`](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPRenderer.h) (HTML renderer), [`MacDown/Code/Document/MPDocument.h`](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPDocument.h) (Document), [`MacDown/Code/View/MPEditorView.h`](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/View/MPEditorView.h) (Markdown editor), [`Dependency/peg-markdown-highlight`](https://github.com/schuyler/macdown3000/tree/main/Dependency/peg-markdown-highlight) (Editor highlighting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Editor Application"]
  node_editor["Markdown editor<br/>[MPEditorView.h]"]
  node_document["Document<br/>[MPDocument.h]"]
  node_preferences["Preferences<br/>[MPPreferences.h]"]
end

subgraph group_render["Markdown Rendering"]
  node_renderer["HTML renderer<br/>[MPRenderer.h]"]
  node_hoedown["Hoedown"]
  node_preview["Live preview<br/>[MPRenderer.h]"]
  node_math["Math rendering<br/>[init.js]"]
  node_tasklist["Task lists<br/>[tasklist.js]"]
  node_table["Table resizing<br/>[table-resize.js]"]
end

subgraph group_highlight["Syntax Highlighting"]
  node_prism["Code highlighting"]
  node_peg["Editor highlighting"]
  node_peg_parser["Markdown parser<br/>[pmh_parser_head.c]"]
  node_peg_definitions["Parser definitions<br/>[pmh_definitions.h]"]
  node_style_parser["Style parser<br/>[pmh_styleparser.c]"]
  node_greg["PEG runtime<br/>[greg.c]"]
  node_greg_compile["PEG compiler<br/>[compile.c]"]
  node_greg_tree["Grammar tree<br/>[tree.c]"]
end

subgraph group_workspace["Workspace &amp; Export"]
  node_folder["Folder sidebar"]
  node_export["HTML/PDF export<br/>[MPDocument.h]"]
  node_quicklook["Quick Look"]
end

node_user(("Mac user"))

node_user -->|"edits Markdown"| node_editor
node_editor -.->|"edits document"| node_document
node_document -->|"renders document"| node_renderer
node_renderer -->|"converts Markdown"| node_hoedown
node_renderer -->|"updates preview"| node_preview
node_renderer -->|"supports math"| node_math
node_renderer -->|"supports task lists"| node_tasklist
node_renderer -.->|"supports tables"| node_table
node_editor -->|"highlights syntax"| node_peg
node_peg -.->|"parses Markdown"| node_peg_parser
node_peg_parser -->|"uses definitions"| node_peg_definitions
node_peg -.->|"parses styles"| node_style_parser
node_greg -.->|"supports compilation"| node_greg_compile
node_greg_compile -.->|"builds grammar tree"| node_greg_tree
node_user -->|"opens workspace"| node_folder
node_folder -->|"opens files"| node_document
node_user -->|"configures options"| node_preferences
node_user -->|"exports document"| node_export
node_document -.->|"previews file"| node_quicklook

click node_editor "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/View/MPEditorView.h"
click node_document "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPDocument.h"
click node_preferences "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Preferences/MPPreferences.h"
click node_renderer "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPRenderer.h"
click node_hoedown "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Extension/hoedown_html_patch.c"
click node_preview "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPRenderer.h"
click node_math "https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/MathJax/init.js"
click node_tasklist "https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/Extensions/tasklist.js"
click node_table "https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/Extensions/table-resize.js"
click node_prism "https://github.com/schuyler/macdown3000/tree/main/MacDown/Resources/Extensions"
click node_peg "https://github.com/schuyler/macdown3000/tree/main/Dependency/peg-markdown-highlight"
click node_peg_parser "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_parser_head.c"
click node_peg_definitions "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_definitions.h"
click node_style_parser "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_styleparser.c"
click node_greg "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/greg.c"
click node_greg_compile "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/compile.c"
click node_greg_tree "https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/tree.c"
click node_folder "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Sidebar/MPFolderSidebarViewController.h"
click node_export "https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPDocument.h"
click node_quicklook "https://github.com/schuyler/macdown3000/blob/main/MacDownQuickLook/PreviewViewController.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_document,node_preferences,node_user toneBlue
class node_renderer,node_hoedown,node_preview,node_math,node_tasklist,node_table toneAmber
class node_prism,node_peg,node_peg_parser,node_peg_definitions,node_style_parser,node_greg,node_greg_compile,node_greg_tree toneMint
class node_folder,node_export,node_quicklook toneRose
```

## Components

### Editor Application

- [Markdown editor](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/View/MPEditorView.h): `MacDown/Code/View/MPEditorView.h`
- [Document](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPDocument.h): `MacDown/Code/Document/MPDocument.h`
- [Preferences](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Preferences/MPPreferences.h): `MacDown/Code/Preferences/MPPreferences.h`

### Markdown Rendering

- [HTML renderer](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPRenderer.h): `MacDown/Code/Document/MPRenderer.h`
- [Hoedown](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Extension/hoedown_html_patch.c): `MacDown/Code/Extension/hoedown_html_patch.c`
- [Live preview](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPRenderer.h): `MacDown/Code/Document/MPRenderer.h`
- [Math rendering](https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/MathJax/init.js): `MacDown/Resources/MathJax/init.js`
- [Task lists](https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/Extensions/tasklist.js): `MacDown/Resources/Extensions/tasklist.js`
- [Table resizing](https://github.com/schuyler/macdown3000/blob/main/MacDown/Resources/Extensions/table-resize.js): `MacDown/Resources/Extensions/table-resize.js`

### Syntax Highlighting

- [Code highlighting](https://github.com/schuyler/macdown3000/tree/main/MacDown/Resources/Extensions): `MacDown/Resources/Extensions`
- [Editor highlighting](https://github.com/schuyler/macdown3000/tree/main/Dependency/peg-markdown-highlight): `Dependency/peg-markdown-highlight`
- [Markdown parser](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_parser_head.c): `Dependency/peg-markdown-highlight/pmh_parser_head.c`
- [Parser definitions](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_definitions.h): `Dependency/peg-markdown-highlight/pmh_definitions.h`
- [Style parser](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/pmh_styleparser.c): `Dependency/peg-markdown-highlight/pmh_styleparser.c`
- [PEG runtime](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/greg.c): `Dependency/peg-markdown-highlight/greg/greg.c`
- [PEG compiler](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/compile.c): `Dependency/peg-markdown-highlight/greg/compile.c`
- [Grammar tree](https://github.com/schuyler/macdown3000/blob/main/Dependency/peg-markdown-highlight/greg/tree.c): `Dependency/peg-markdown-highlight/greg/tree.c`

### Workspace & Export

- [Folder sidebar](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Sidebar/MPFolderSidebarViewController.h): `MacDown/Code/Sidebar/MPFolderSidebarViewController.h`
- [HTML/PDF export](https://github.com/schuyler/macdown3000/blob/main/MacDown/Code/Document/MPDocument.h): `MacDown/Code/Document/MPDocument.h`
- [Quick Look](https://github.com/schuyler/macdown3000/blob/main/MacDownQuickLook/PreviewViewController.h): `MacDownQuickLook/PreviewViewController.h`

### Other components

- **Mac user**

## Connections

- Mac user → Markdown editor: edits Markdown (evidence: `README.md`)
- Markdown editor → Document: edits document
- Document → HTML renderer: renders document (evidence: `README.md`)
- HTML renderer → Hoedown: converts Markdown (evidence: `README.md`)
- HTML renderer → Live preview: updates preview (evidence: `README.md`)
- HTML renderer → Math rendering: supports math (evidence: `README.md`)
- HTML renderer → Task lists: supports task lists (evidence: `README.md`)
- HTML renderer → Table resizing: supports tables
- Markdown editor → Editor highlighting: highlights syntax (evidence: `README.md`)
- Editor highlighting → Markdown parser: parses Markdown (evidence: `Dependency/peg-markdown-highlight/pmh_parser_head.c`)
- Markdown parser → Parser definitions: uses definitions
- Editor highlighting → Style parser: parses styles (evidence: `Dependency/peg-markdown-highlight/pmh_styleparser.c`)
- PEG runtime → PEG compiler: supports compilation
- PEG compiler → Grammar tree: builds grammar tree
- Mac user → Folder sidebar: opens workspace (evidence: `README.md`)
- Folder sidebar → Document: opens files (evidence: `README.md`)
- Mac user → Preferences: configures options (evidence: `README.md`)
- Mac user → HTML/PDF export: exports document (evidence: `README.md`)
- Document → Quick Look: previews file
