Skip to content

Commit e2b212a

Browse files
committed
Introduce generation of AI files
1 parent 6b88612 commit e2b212a

14 files changed

+1266
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update latest rules when changes pushed to main
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout current repo
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
18+
with:
19+
node-version: '20'
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
25+
- name: Generate AI file
26+
run: yarn generate:ai
27+
28+
- name: Run git config
29+
run: |
30+
git config user.name "GitHub Actions Bot"
31+
git config user.email "<>"
32+
33+
- name: Commit and push changes
34+
run: |
35+
git add ai/liquid.mdc
36+
git commit -m "Update ai/liquid.mdc"
37+
git push origin main

README.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1-
# Theme Liquid Docs
1+
# Theme Liquid Docs
22

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

Comments
 (0)