https://github.com/robcxyz/tackle-demo
https://github.com/robcxyz/tackle-demo
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/robcxyz/tackle-demo
- Owner: robcxyz
- Created: 2021-12-05T07:06:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T05:31:10.000Z (over 1 year ago)
- Last Synced: 2025-01-31T07:33:12.663Z (4 months ago)
- Language: Python
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tackle-demo
Simple demo to introduce the format and features for [`tackle-box`](https://github.com/geometry-labs/tackle-box)
```
pip3 install tackle-box
tackle https://github.com/robcxyz/tackle-demo
```This demo walks you through many of the aspects of tackle boxes DSL.
```shell
? What demos do you want to do? (, to move, to select, to toggle, to invert)
❯○ Monty Python basic demo
○ Embedded tackle boxes
○ A tutorial of all the hooks and providers
○ A tutorial on useful patterns with jinja
○ Galllery of the most popular cookiecutters
```### Basic Demo
Simply write your tackle box per this format. The key in the jinja syntax defaults to the context filename for the template, in this case `yaml`.
A `tackle.yaml` file placed in a directory and run with `tackle .` would call the script.
```yaml
---
name:
type: input
message: What is your name?colors:
type: checkbox
message: What are your favorite colors?
choices:
- blue
- green
- greywingspeed:
type: select
message: What is the airspeed velocity of an unladen swallow??
choices:
- I donno
- What do you mean? African or European swallow?bad_outcome:
type: print
statement: Wrong answer {{ name }}... (Flung off bridge)
when: "{{ 'I donno' in wingspeed }}"color_essays:
type: input
message: Please tell me how much you like the color {{item}}?
default: Oh color {{item}}, you are so frickin cool...
loop: "{{ colors }}"
when: "{{ colors|length > 0 }}"
```