How bkuhlmann/superfluid works
Superfluid is a Ruby extension to Liquid that composes configurable environments, reusable filters and tags, and template rendering. The main workflow is a caller creating a renderer, rendering template text with data, and receiving rendered text; templates can also define and render in-memory partials. The README documents local and blank Liquid file systems as alternatives. Renderer, configuration, tag registry, and tag-container source was not sampled, so their internal wiring is shown only where documented, without asserting unverified calls.
Main entry points: renderer.rb Renderer · configuration.rb Configuration · environment.rb Environment · filter.rb Filter registry
Components 16
Public API
- Superfluid API
lib/superfluid.rb - Renderer
lib/superfluid/renderer.rb
Environment setup
- Environment
lib/superfluid/environment.rb - Configuration
lib/superfluid/configuration.rb
Filter composition
- Filter registry
lib/superfluid/registries/filter.rb - Built-in filters
lib/superfluid/filters/container.rb
Template rendering
- Tag registry
lib/superfluid/registries/tag.rb - Built-in tags
lib/superfluid/tags/container.rb - Template tag
lib/superfluid/tags/template.rb - Memory filesystem
lib/superfluid/systems/memory.rb
Other components
- Application caller
- Liquid engine
- Custom filters
- Template and data
- Rendered text
- Liquid filesystems
Connections 23
- Application caller → Superfluid API: creates renderer
- Superfluid API → Environment: builds environment
- Superfluid API → Renderer: creates renderer
- Renderer → Environment: uses environment
- Environment → Configuration: uses configuration
- Configuration → Filter registry: configures filters
- Configuration → Tag registry: configures tags
- Filter registry → Built-in filters: loads defaults
- Environment → Filter registry: registers filters
- Environment → Tag registry: registers tags
- Filter registry → Custom filters: registers callables
- Renderer → Liquid engine: renders through
- Renderer → Template and data: accepts template and data
- Liquid engine → Filter registry: dispatches filters
- Liquid engine → Tag registry: resolves tags
- Tag registry → Built-in tags: provides tags
- Liquid engine → Template tag: executes tag
- Template tag → Memory filesystem: registers template
- Liquid engine → Memory filesystem: reads templates
- Configuration → Memory filesystem: defaults filesystem
- Configuration → Liquid filesystems: accepts alternative
- Liquid engine → Rendered text: produces output
- Renderer → Rendered text: returns output