···5566## Development Commands
7788-- **Start development server**: `deno task dev` or
99- `deno run --unstable-broadcast-channel --allow-env --allow-net --allow-read --allow-write main.ts dev <path-to-markdoc-file>`
88+- **Start development server**: `deno task dev <markdoc-file>` or
99+ `deno run --unstable-broadcast-channel --allow-env --allow-net --allow-read --allow-write main.ts dev <markdoc-file>`
1010+- **Build static presentation**: `deno task build <markdoc-file>` or
1111+ `deno run --allow-env --allow-read --allow-write main.ts build <markdoc-file> --output <directory>`
10121113## Architecture Overview
1214···1921```
2022morkdeck/
2123├── cli/ # CLI command definitions
2222-│ └── dev.ts # Dev command interface
2424+│ ├── dev.ts # Dev command interface
2525+│ └── build.ts # Build command interface
2326├── core/ # Core rendering logic
2427│ ├── markdoc-config.ts # Markdoc configuration
2528│ ├── nodes/ # Custom Markdoc nodes
2629│ │ └── fence.ts # Code fence with Shiki/Mermaid
2727-│ └── renderer.ts # Main rendering pipeline
3030+│ ├── renderer.ts # Main rendering pipeline
3131+│ └── types.ts # TypeScript type definitions
2832├── server/ # Development server implementation
2933│ └── dev.ts # Live-reload server logic
3030-├── templates/ # HTML templates
3131-│ └── live-reload.eta
3434+├── templates/ # Eta templates
3535+│ ├── presentation.eta # Main template
3636+│ └── partials/ # Template partials
3737+│ ├── live-reload.eta # Live-reload scripts
3838+│ ├── mermaid.eta # Mermaid initialization
3939+│ └── slide-styles.eta # CSS styles
3240└── main.ts # Entry point
3341```
3442···364437451. **CLI Layer** (`cli/`): Command definitions using Cliffy framework
3846 - `cli/dev.ts`: Dev command that delegates to server implementation
4747+ - `cli/build.ts`: Build command for static HTML generation
394840492. **Server Layer** (`server/`): Development server functionality
4150 - `server/dev.ts`: Live-reload server, file watching, WebSocket handling
4251 - Serves presentations at port 8000
4343- - Uses Eta templating engine for HTML generation
5252+ - Uses consolidated template system
445345543. **Core Rendering** (`core/`): Markdoc processing and rendering
4646- - `core/renderer.ts`: Main rendering pipeline, slide grouping
4747- - `core/markdoc-config.ts`: Markdoc configuration assembly
4848- - `core/nodes/fence.ts`: Code fence node with Shiki syntax highlighting and
4949- Mermaid support
5555+ - `core/renderer.ts`: Unified rendering pipeline with `renderPresentationHtml()`
5656+ - `core/markdoc-config.ts`: Markdoc configuration with includes tracking
5757+ - `core/nodes/fence.ts`: Code fence node with Shiki syntax highlighting and Mermaid support
5858+ - `core/types.ts`: Type definitions for render options and includes
50595160### Key Dependencies
5261···5665- **shiki**: Syntax highlighting for code blocks
5766- **hast-util-is-element**: HAST tree utilities for Shiki integration
58676868+### Template System
6969+7070+**Consolidated Template Architecture:**
7171+- **`templates/presentation.eta`**: Main template for both dev and static builds
7272+- **`templates/partials/`**: Modular template components
7373+ - `live-reload.eta`: WebSocket live-reload functionality (dev only)
7474+ - `mermaid.eta`: Mermaid diagram initialization scripts
7575+ - `slide-styles.eta`: CSS styling for presentations
7676+7777+**Template Features:**
7878+- **Includes System**: Dynamic script/style injection based on content needs
7979+- **Mode Detection**: Automatic dev vs static build differentiation
8080+- **Partial Composition**: Modular template components for maintainability
8181+5982### Presentation Structure
60836184- Each Markdoc file represents a complete presentation
6285- Slides are separated by `---` (horizontal rules)
6363-- The rendering process wraps each slide section in semantic HTML with custom
6464- tags:
8686+- The rendering process wraps each slide section in semantic HTML with custom tags:
6587 - `slide` tag → `<section>` element
6688 - `content` tag → `<div>` element
6789- CSS uses container queries and scroll-snap for responsive slide navigation
···6991### Code Highlighting Features
70927193- **Shiki Integration**: Rose Pine theme syntax highlighting for code blocks
7272-- **Mermaid Support**: Automatic detection and script injection for Mermaid
7373- diagrams
9494+- **Mermaid Support**: Automatic detection and script injection for Mermaid diagrams
7495- **Language Detection**: Automatic language detection from fence attributes
7596- **HAST Processing**: Converts Shiki HAST output to Markdoc render nodes
76979898+### Build System
9999+100100+**Development Mode (`deno task dev`):**
101101+- Live-reload server at port 8000
102102+- File watching with automatic rebuild
103103+- WebSocket-based browser refresh
104104+- No cache headers for development
105105+106106+**Static Build (`deno task build`):**
107107+- Single HTML file output
108108+- No live-reload dependencies
109109+- Optimized for deployment
110110+- Custom output directory support
111111+77112### Styling Approach
7811379114The presentation uses a dark theme with centered layout:
8080-81115- Full viewport slides with scroll-snap navigation
82116- Container queries for responsive typography
83117- Recursive font family with variable font features and monospace code support
8484-- Rose Pine color scheme (`#191724` background, `#e0def4` headings, `#908caa`
8585- text)
118118+- Rose Pine color scheme (`#191724` background, `#e0def4` headings, `#908caa` text)
861198787-### Live Reload System
120120+### Extending the System
881218989-Uses Deno's BroadcastChannel API to coordinate between:
9090-9191-- File watcher that detects changes to the source Markdoc file
9292-- WebSocket connection that triggers browser reload
9393-- No external dependencies required for hot reloading
9494-9595-### Extending Nodes
9696-9797-To add new custom Markdoc nodes:
9898-122122+**Adding Custom Markdoc Nodes:**
991231. Create a new file in `core/nodes/`
1001242. Export a function that returns a Markdoc node configuration
1011253. Import and add to the `nodes` object in `core/markdoc-config.ts`
126126+127127+**Adding Template Partials:**
128128+1. Create new `.eta` files in `templates/partials/`
129129+2. Use includes system to conditionally load based on content needs
130130+3. Update `core/markdoc-config.ts` to track new includes