How liamriddell/obsidian-solve works
Core Architecture Components:
Main Components
• Expression Processing Pipeline
• Provider System
• Grammar System
• Result System
• Settings Management
• UI Integration (CodeMirror Plugin)
Core Flow
• It to the MarkdownEditorViewPlugin (CodeMirror integration)
• Event flow through the PluginEventBus
Expression Processing Pipeline (Central Component)
• Input Expression
• Sequential Stages:
• Comments Removal
• Markdown Removal
• Variable Processing
• Expression Processing
• Result Formatting
Provider System (Left Side)
Different providers as modules:
• BasicArithmeticProvider
• DatetimeProvider
• PercentageArithmeticProvider
• UnitsOfMeasurementProvider
• VectorArithmeticProvider
• FunctionArithmeticProvider
To the central pipeline.
Grammar System (Right Side)
Ohm-js grammar components:
• Arithmetic Grammar
• DateTime Grammar
• Vector Grammar
• UOM Grammar
Connections to corresponding providers.
Result System (Bottom)
• Different result types (NumberResult, DatetimeResult, etc.)
• Result formatting and coercion system
• Cache system (ResultCache)
Component Relationships
Interactions:
• Provider Manager → Providers
• Providers ↔ Grammars
• Pipeline Stages ↔ Visitors
• Results ↔ Coercion System
Use diamonds for decision points
• Symbols for different component types
Level of Detail:
• Keep main components visible at high level
• Use collapsible/expandable sections for sub-components
• Interfaces between components
• Error handling paths