How thunderer/shortcode works
Main Components
a) Core Processing Pipeline:
• Input Text → Parser → Processor → Handler → Output Text
• Parser System
• RegularParser, RegexParser, and WordpressParser as subcomponents
• To Syntax module
• Handler System
• HandlerContainer and various handlers
• Event System
• EventContainer and event handlers
• Serialization System
• Different serializer implementations (JSON, XML, YAML, Text)
Component Relationships
• Interface: ParserInterface
• Implementations: RegularParser, RegexParser, WordpressParser
• Connection to SyntaxInterface for configuration
• HandlerContainer at the center
• Various handlers (EmailHandler, UrlHandler, etc.) connected to it
• Handler registration flow
• EventContainer
• Event types (FilterShortcodesEvent, ReplaceShortcodesEvent)
• Connection points to the main processing pipeline
• A separate module with SerializerInterface
Architectural Elements
• Blue: Core processing components
• Green: Handlers and implementations
• Yellow: Interfaces
• Orange: Event system
• Purple: Serialization system
b) Symbols:
• Interfaces: <<interface>> stereotype
• Abstract classes: <<abstract>> stereotype
• Event handlers: Lightning bolt symbol
Key Interactions
• How text flows through the system
• How handlers are registered and called
• How events intercept the processing
• How serialization integrates
Additional Details
A section showing:
• Configuration options
• Syntax customization
• Handler registration
• Event handling points
Notes
Explanatory notes for:
• Processing pipeline stages
• Configuration options
• Extension points
• Common use cases
Remember to highlight the facade pattern implementation (ShortcodeFacade) as it provides a simplified interface to the entire system.