|
1 |
| -# Theme Liquid Docs |
| 1 | +# Theme Liquid Docs |
2 | 2 |
|
3 |
| -A reference for liquid documentation that is auto-updated based on any changes to the liquid schema. |
| 3 | +Auto-generated documentation for Liquid schemas, drops, tags, and filters. Documentation stays fresh—whenever you update the schema, docs regenerate automatically. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +```bash |
| 8 | +git clone https://github.com/Shopify/theme-liquid-docs |
| 9 | +cd theme-liquid-docs |
| 10 | +yarn install |
| 11 | +``` |
| 12 | + |
| 13 | +## What's Inside |
| 14 | + |
| 15 | +- **`data/`** — JSON files with Liquid drops, tags, and filters for themes |
| 16 | +- **`schemas/`** — JSON Schema definitions for Liquid theme artifacts |
| 17 | +- **`ai/`** — Context files that power AI-generated Liquid rules |
| 18 | +- **`tests/`** — Test suite ensuring documentation accuracy |
| 19 | +- **`scripts/`** — Automation scripts for docs generation |
| 20 | + |
| 21 | +## Working with AI files |
| 22 | + |
| 23 | +The AI sources generates comprehensive Liquid guidelines from modular rules files. |
| 24 | + |
| 25 | +### How it works |
| 26 | + |
| 27 | +The main AI file is `ai/liquid.mdc`, generated from `ai/sources/index.liquid`. This entry point pulls together: |
| 28 | + |
| 29 | +- Context from `ai/sources/*.md` files |
| 30 | +- Dynamic content from `ai/sources/*.liquid` templates |
| 31 | + |
| 32 | +Choose `.md` for static content, `.liquid` for dynamic generation. |
| 33 | + |
| 34 | +### Adding new rules |
| 35 | + |
| 36 | +1. **Create your rule file:** |
| 37 | + ```bash |
| 38 | + # Static content |
| 39 | + touch ai/sources/my-new-rule.md |
| 40 | + |
| 41 | + # Or dynamic content |
| 42 | + touch ai/sources/my-new-rule.liquid |
| 43 | + ``` |
| 44 | + |
| 45 | +2. **Add your content:** |
| 46 | + ```liquid |
| 47 | + <!-- ai/sources/my-new-rule.liquid --> |
| 48 | + {% for filter in filters %} |
| 49 | + - `{{ filter.name }}` — {{ filter.description }} |
| 50 | + {% endfor %} |
| 51 | + ``` |
| 52 | + |
| 53 | +3. **(Optional) Regenerate the rules:** |
| 54 | + The `ai/liquid.mdc` file updates automatically via GitHub Actions, but you can generate it locally anytime. |
| 55 | + ```bash |
| 56 | + yarn generate:ai |
| 57 | + ``` |
| 58 | + |
| 59 | +### Available data |
| 60 | + |
| 61 | +In `.liquid` templates, you have access to: |
| 62 | +- `filters` — All available Liquid filters |
| 63 | +- `tags` — All Liquid tags |
| 64 | +- `objects` — All Liquid objects |
| 65 | + |
| 66 | +Check `ai/sources/_liquid-rules.liquid` for examples. |
| 67 | + |
| 68 | +## Contributing |
| 69 | + |
| 70 | +Help us make these docs better: |
| 71 | + |
| 72 | +1. **Fork** this repository |
| 73 | +2. **Create** your feature branch (`git checkout -b improve-liquid-docs`) |
| 74 | +3. **Commit** your changes (`git commit -m 'Add array filter examples'`) |
| 75 | +4. **Push** and create a Pull Request |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +MIT License. See [LICENSE](./LICENSE.md) for details. |
0 commit comments