How andrewbrey/mdrb works
Main Components
a. Input Sources Layer:
• Local Markdown Files
• Remote Markdown URLs
• Stdin Pipe
b. Core Processing Layer:
• Markdown Parser
• Code Block Extractor
• Configuration Parser (TOML)
• Code Block Processor
c. Execution Layer:
• Deno Runtime Environment
• Dax Integration
• Execution Modes Manager
d. Output/Interface Layer:
• Terminal Interface
• Progress/Status Display
• Interactive Prompts
Component Relationships and Data Flow
• Input → Parser → Processor → Executor → Output
• Configuration flow from TOML parser to execution settings
• Dax integration path into code blocks
• Mode selection impact on execution flow
┌─────────────────────────────────────────────────────────┐
• Input Sources │
• ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
• Local MD Files│ │Remote MD URLs│ │Stdin Pipe │ │
• ┬──────┘ └──────┬───────┘ └─────┬───────┘ │
• ┼───────────────┬─┼───────────────┬─┼──────────┘
┌─────────▼───────────────▼─▼───────────────▼─▼──────────┐
• Core Processing │
• ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
• Markdown │ │Code Block │ │Config │ │
• Parser ├──►│Extractor │◄──┤Parser(TOML) │ │
• ┘ └──────┬───────┘ └─────────────┘ │
• ┬──┼────────────────────────────┘
┌────────────────────────▼──▼────────────────────────────┐
• Execution Layer │
• ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
• Deno Runtime │◄──┤Mode Manager │◄──┤Dax │ │
• Environment │ │(Runbook/ │ │Integration │ │
• ┬──────┘ │Isolated/ │ └─────────────┘ │
• Single) │ │
• ┬───────┘ │
• ┼───────────────┬┼─────────────────────────────┘
┌─────────▼───────────────▼▼────────────────────────────┐
• Output Interface │
• ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
• Terminal │ │Progress │ │Interactive │ │
• Output │◄──┤Display │◄──┤Prompts │ │
• ┘ └──────────────┘ └─────────────┘ │
• ┘
Implementation Notes
• cli.ts as the entry point
• markdown.ts for parsing
• util.ts for helper functions
• Integration with external dependencies
This system design accurately represents MDRB as a CLI tool that transforms Markdown documentation into executable runbooks, with clear separation of concerns between input handling, processing, execution, and output management.