liquify 1.3.0
SDKdartflutter
Platformandroidioswindowslinuxmacos
A powerful and extensible Liquid template engine for Dart. Supports full Liquid syntax, custom tags and filters, and high-performance parsing and rendering.
Examples
This directory contains comprehensive examples demonstrating various features and capabilities of the Liquid Grammar library.
Quick Start Examples
Basic Usage
- Template rendering fundamentals
- Variable interpolation
- Filters and data transformation
- Custom filters and tags
Template Layouts
- Layout inheritance patterns
- Block definitions and overrides
- Multi-level template hierarchies
- Dynamic layout selection
File System Integration
- Template loading from files
- Template inclusion and rendering
- File system abstraction
- Error handling for missing files
Advanced Examples
Custom Tags
- Creating custom tag implementations
- Parser integration patterns
- Complex tag logic with multiple blocks
- Tag registration and usage
Drop Objects
- Custom object model integration
- Property access patterns
- Method invocation from templates
- Nested object hierarchies
Example Categories
| Category | Description | Examples |
|---|---|---|
| Basic | Fundamental template operations | Variable output, loops, conditionals |
| Filters | Data transformation examples | Custom filters, filter chaining |
| Tags | Control flow and custom logic | Custom tags, block tags |
| Layouts | Template inheritance | Layout systems, block overrides |
| Objects | Custom data models | Drop classes, property access |
| Files | File system integration | Template loading, includes |
Running Examples
All examples are self-contained Dart programs that can be run directly:
# Run basic example
dart run example/example.dart
# Run layout example
dart run example/layout.dart
# Run custom tag example
dart run example/custom_tag.dart
# Run drop objects example
dart run example/drop.dart
# Run file system example
dart run example/fs.dart
Example Output
Each example produces formatted output demonstrating the specific features:
- Template rendering results - Showing the final generated content
- Feature demonstrations - Highlighting specific functionality
- Error handling - Showing graceful failure modes
- Performance patterns - Efficient usage examples
Related Documentation
- Tags Documentation - Complete tag reference
- Filters Documentation - Complete filter reference
- API Reference - Core library documentation
Contributing Examples
When adding new examples:
- Create self-contained, runnable examples
- Include comprehensive comments
- Demonstrate both basic and advanced usage
- Show error handling patterns
- Provide expected output in comments