Skip to content

Commit de97003

Browse files
committed
Update docs.
1 parent d7da524 commit de97003

4 files changed

Lines changed: 16 additions & 31 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Panel :context="pageContext.pageInfo" tone="accent" variant="surface" bodyClass="p-3" class="mb-4">
2+
<p class="text-eyebrow mt-0">From this page's frontmatter</p>
3+
<strong>{{ frontmatter.title }}</strong>
4+
<ul class="mb-0">
5+
<li r-for="item in frontmatter.highlights">
6+
{{ item }}
7+
</li>
8+
</ul>
9+
</Panel>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<RegorApp id="launch-checklist" src="./regor-launch-checklist.ts"/>

frontend/purestack.studio/guides/extending/regor-launch-checklist.ts renamed to frontend/purestack.studio/guides/extending/regor/regor-launch-checklist.ts

File renamed without changes.

frontend/purestack.studio/guides/extending/regor.mdx renamed to frontend/purestack.studio/guides/extending/regor/regor.mdx

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -202,34 +202,11 @@ Text in double braces is a Regor expression, anywhere in a page. Inside markup,
202202
| `pageContext.navigation`, `pageContext.outline` | The page's navigation and heading outline |
203203
| `pageContext.locale`, `pageContext.locales` | The page's language and the site's languages |
204204

205-
This page lists three highlights in its frontmatter. The panel below reads them during the build:
206-
207-
<Panel tone="accent" variant="surface" bodyClass="p-3" class="mb-4">
208-
<p class="text-eyebrow mt-0">From this page's frontmatter</p>
209-
<strong>{{ pageContext.pageInfo.frontmatter.title }}</strong>
210-
<ul class="mb-0">
211-
<li r-for="item in pageContext.pageInfo.frontmatter.highlights">
212-
{{ item }}
213-
</li>
214-
</ul>
215-
</Panel>
205+
This page lists three highlights in its frontmatter. The panel below reads them during the build. `:context="pageContext.pageInfo"` makes `frontmatter` available directly inside the panel:
216206

217-
```mdx
218-
---
219-
title: Regor
220-
highlights:
221-
- One component model for pages and apps
222-
- Plain TypeScript, no compiler plugin
223-
- Built-in components and theme styles in both places
224-
---
207+
<import-content src="./_regor-frontmatter.mdx"/>
225208

226-
<Panel tone="accent" variant="surface" bodyClass="p-3">
227-
<strong>{{ pageContext.pageInfo.frontmatter.title }}</strong>
228-
<ul>
229-
<li r-for="item in pageContext.pageInfo.frontmatter.highlights">{{ item }}</li>
230-
</ul>
231-
</Panel>
232-
```
209+
<import-codeblock src="./_regor-frontmatter.mdx"/>
233210

234211
`r-if`, `r-else-if`, and `r-else` choose what to render. `r-for` repeats an element for each item. Loop over data from frontmatter, the page context, or component state.
235212

@@ -322,11 +299,9 @@ Tag names match registered keys regardless of case, so `<ReleaseNote>` finds `re
322299

323300
Place a `RegorApp` in a page and point it at a TypeScript file next to the page. It renders an `app` element with the `id` you give it and loads the script. The script calls `createApp` with the matching selector:
324301

325-
<RegorApp id="launch-checklist" src="./regor-launch-checklist.ts"/>
302+
<import-content src="./_regor-launch-checklist.mdx"/>
326303

327-
```mdx
328-
<RegorApp id="launch-checklist" src="./regor-launch-checklist.ts"/>
329-
```
304+
<import-codeblock src="./_regor-launch-checklist.mdx"/>
330305

331306
<import-codeblock src="./regor-launch-checklist.ts"/>
332307

@@ -490,7 +465,7 @@ These patterns scale from a single widget to a multi-page admin tool with tables
490465

491466
## Use other libraries
492467

493-
A [PageScript](/components/runtime/page-script/) loads a browser entry point. Use it to enhance existing HTML or mount a browser-compatible library. PureStack bundles local TypeScript and its imports with esbuild; framework-specific source formats may need an additional compilation step. Start with a plain TypeScript module, as shown in [runtime scripts](../../components/runtime).
468+
A [PageScript](/components/runtime/page-script/) loads a browser entry point. Use it to enhance existing HTML or mount a browser-compatible library. PureStack bundles local TypeScript and its imports with esbuild; framework-specific source formats may need an additional compilation step. Start with a plain TypeScript module, as shown in [runtime scripts](../../../components/runtime).
494469

495470
<AlertBox tone="warning" icon="tabler:alert-triangle" title="What you give up">
496471
Other frameworks can't use the built-in components, and they don't inherit the

0 commit comments

Comments
 (0)