This directory contains example Echo templates demonstrating various features.
File: movie-recommender.echo
Demonstrates:
- Variable substitution:
{{companions}},{{genre}} - Conditionals with
#containsoperator - Conditionals with
#equalsoperator - Context-dependent content
Run:
echopdk render movie-recommender.echo --context-file movie-recommender.context.jsonExpected output:
You are a Context-Aware Movie Curator.
Your goal is to recommend the perfect movie based on who I am watching with (Shimon) and the preferred genre (SciFi).
**Watching with Shimon - Rules:**
* **Preference:** We love 80s/90s Action or Sci-Fi cult classics.
* **Constraint:** Do not recommend anything released after 2015 unless it has a rating above 8.5 on IMDB.
Based on the constraints above, recommend ONE movie. Explain why it fits the specific requirements for this viewing context.
File: customer-support.echo
Demonstrates:
- Default values:
{{company ?? "our company"}} - Section definitions:
[#SECTION name="greeting"] - Section includes:
[#INCLUDE greeting] - Nested conditionals
- Multiple operators:
#equals,#lte,#exists
- Create a
.echofile with your template - Create a
.context.jsonfile with sample data - Run:
echopdk render your-template.echo --context-file your-context.json
{{variable}} # Variable
{{var ?? "default"}} # Default value
[#IF {{x}} #equals(y)]...[END IF] # Conditional
[#SECTION name="x"]...[END SECTION] # Section definition
[#INCLUDE x] # Section include
[#IMPORT ./path.echo] # Import file