How delfanbaum/asciidocr works
Main Components
a. Input Layer:
• File Input Handler (supports files and stdin)
• Resolution System (shown by nested-includes support in tests)
b. Processing Pipeline:
• Scanner Component (src/scanner)
• Tokenization (tokens.rs)
• Parser Component (src/parser.rs)
• Abstract Syntax Graph (src/graph)
• Blocks
• Inlines
• Lists
• Metadata
• Nodes
c. Backend Rendering Layer (src/backends):
• HTMLBook Backend
• DOCX Backend (experimental)
• JSON Backend (for testing/compatibility)
Key Relationships
• Input → Scanner → Parser → ASG → Backend Renderers → Output
• Template system's connection to the backends
• Relationship between the ASG components
Specific Implementation Details
[Input] → [Scanner] → [Parser] → [ASG] → [Backend Selection] → [Renderers]
• ↑ ↓
[Include] [Templates]
Resolution ↓
• [HTMLBook] [DOCX] [JSON]
Additional Elements
• A note about the experimental status of the DOCX backend
• Relationship with the testing infrastructure
• Where the CLI interface (src/bin/asciidocr) fits in
Important Architectural Patterns to Highlight
• Pipeline processing pattern
• Plugin-style backend system
• Template-based rendering
• Abstract Syntax Graph for intermediate representation