Skip to content

Commit bc989aa

Browse files
committed
fix: update markdown code block syntax for template directives to ensure proper rendering
1 parent 302f46d commit bc989aa

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

apps/docs/docs/reference/template-syntax.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ module.exports = {
4848

4949
Directives are embedded in markdown code blocks using YAML syntax:
5050

51-
```markdown
51+
````markdown
5252
```{petk:include}
5353
path: shared/header.md
5454
```
55-
```
55+
````
5656

5757
### Include Directive
5858

5959
The most powerful feature for embedding content from other files.
6060

6161
#### Basic File Inclusion
6262

63-
```markdown
63+
````markdown
6464
```{petk:include}
6565
path: shared/header.md
6666
```
@@ -70,13 +70,13 @@ path: templates/card.md
7070
title: My Card
7171
content: Card description
7272
```
73-
```
73+
````
7474

7575
#### Advanced Glob Patterns
7676

7777
Include multiple files using glob patterns with sorting and filtering:
7878

79-
```markdown
79+
````markdown
8080
```{petk:include}
8181
glob: posts/**/*.md
8282
order_by: alphabetical_asc
@@ -94,7 +94,7 @@ order_by: random
9494
seed: 12345
9595
limit: 3
9696
```
97-
```
97+
````
9898

9999
#### Sorting Options
100100

@@ -119,7 +119,7 @@ limit: 3
119119

120120
Show or hide content based on conditions:
121121

122-
```markdown
122+
````markdown
123123
```{petk:if}
124124
condition: environment === 'development'
125125
```
@@ -130,18 +130,18 @@ condition: user.role === 'admin'
130130
```
131131
# Admin Panel
132132
Administrative content here.
133-
```
133+
````
134134

135135
### Variable Directive
136136

137137
Define and use variables within templates:
138138

139-
```markdown
139+
````markdown
140140
```{petk:var}
141141
name: user_count
142142
value: 42
143143
```
144-
```
144+
````
145145

146146
**Configuration Example:**
147147
```javascript
@@ -163,7 +163,7 @@ module.exports = {
163163

164164
The template engine automatically handles nested includes with cycle detection:
165165

166-
```markdown
166+
````markdown
167167
# Main Document
168168
```{petk:include}
169169
path: sections/intro.md
@@ -174,15 +174,15 @@ path: sections/intro.md
174174
path: shared/welcome.md
175175
```
176176
This creates a nested inclusion hierarchy.
177-
```
177+
````
178178

179179
**Cycle Detection:** The engine prevents infinite loops by detecting circular include dependencies and reporting clear error messages.
180180

181181
### Complex Glob Patterns
182182

183183
Advanced file selection using glob patterns:
184184

185-
```markdown
185+
````markdown
186186
```{petk:include}
187187
glob: "**/*.md"
188188
exclude: "**/draft/**"
@@ -198,20 +198,20 @@ order_by: "last_updated_desc"
198198
limit: 10
199199
exclude: "{drafts,archive}/**"
200200
```
201-
```
201+
````
202202

203203
### Deterministic Sampling
204204

205205
Generate consistent random selections using seeds:
206206

207-
```markdown
207+
````markdown
208208
```{petk:include}
209209
glob: "examples/**/*.md"
210210
order_by: "random"
211211
seed: 42
212212
limit: 3
213213
```
214-
```
214+
````
215215

216216
This is useful for:
217217
- Consistent documentation builds
@@ -222,24 +222,24 @@ This is useful for:
222222

223223
Pass variables to included files for dynamic content:
224224

225-
```markdown
225+
````markdown
226226
```{petk:include}
227227
path: "templates/feature.md"
228228
name: "Authentication"
229229
status: "stable"
230230
version: "2.1.0"
231231
```
232-
```
232+
````
233233

234234
**templates/feature.md:**
235-
```markdown
235+
````markdown
236236
## {{name}} Feature
237237

238238
**Status:** {{status}}
239239
**Version:** {{version}}
240240

241241
This feature provides...
242-
```
242+
````
243243

244244
## Configuration Integration
245245

@@ -319,15 +319,15 @@ Referenced in: 'templates/layout.md' at line 10
319319

320320
### Glob Pattern Optimization
321321

322-
```markdown
322+
````markdown
323323
```{petk:include}
324324
glob: "docs/api/**/*.md"
325325
```
326326

327327
```{petk:include}
328328
glob: "**/**/**/*.md"
329329
```
330-
```
330+
````
331331

332332
### Caching
333333

@@ -347,7 +347,7 @@ For large projects:
347347

348348
### Documentation Site
349349

350-
```markdown
350+
````markdown
351351
```{petk:include}
352352
path: "shared/header.md"
353353
title: "{{site.title}}"
@@ -364,11 +364,11 @@ order_by: "alphabetical_asc"
364364
```{petk:include}
365365
path: "shared/footer.md"
366366
```
367-
```
367+
````
368368

369369
### Blog Generation
370370

371-
```markdown
371+
````markdown
372372
# Latest Posts
373373

374374
```{petk:include}
@@ -383,11 +383,11 @@ limit: 5
383383
glob: "posts/**/*.md"
384384
order_by: "last_updated_desc"
385385
```
386-
```
386+
````
387387

388388
### Code Documentation
389389

390-
```markdown
390+
````markdown
391391
# API Reference
392392

393393
```{petk:include}
@@ -403,7 +403,7 @@ order_by: "random"
403403
seed: 1234
404404
limit: 3
405405
```
406-
```
406+
````
407407

408408
## Migration from Other Template Engines
409409

@@ -424,7 +424,7 @@ user: users
424424
- {{user.name}} - {{user.email}}
425425
```{petk:endfor}
426426
```
427-
````
427+
`````
428428

429429
### From Jekyll/Liquid
430430

@@ -436,7 +436,7 @@ user: users
436436
{% endfor %}
437437
```
438438

439-
```markdown
439+
````markdown
440440
```{petk:include}
441441
path: "shared/header.md"
442442
title: "My Site"
@@ -446,7 +446,7 @@ title: "My Site"
446446
glob: "posts/**/*.md"
447447
limit: 5
448448
```
449-
```
449+
````
450450

451451
## Debugging Templates
452452

0 commit comments

Comments
 (0)