Skip to content

Commit 6ff01fd

Browse files
committed
Replace legacy documentation migrations with one seed and stable example IDs
1 parent c231a28 commit 6ff01fd

20 files changed

Lines changed: 287 additions & 190 deletions

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ relevant tests and the formatting/lint checks in CONTRIBUTING.md before stopping
3838
Report unavailable checks and failures accurately; a test summary followed by a
3939
hung process is a failure.
4040

41-
Update the existing page or documentation migration for changed behavior. Add a
42-
migration only for new documentation content.
41+
Update the existing documentation page or its authored source under
42+
`examples/official-site/content/` for changed behavior.
4343

4444
Build and preview the official site with the commands in its [README](./examples/official-site/README.md).
4545
Update `configuration.md` for configuration changes.

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Architectural constraints and documentation maintenance rules are in
111111
[AGENTS.md](./AGENTS.md).
112112

113113
Edit existing documentation in the [official site](./examples/official-site/) in place.
114-
Deployment recreates the website's database from the site's SQL migrations.
114+
Deployment recreates the website's database from the generated documentation
115+
seed and the site's checked-in migrations.
115116

116117
Run `npm run site` to preview changes using the same site build as deployment.
117118

‎examples/official-site/README.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The SQLPage website is of course built with SQLPage !
44

55
Things that you may be interested to look at:
66
- The [custom component we use for our stylish home page](./sqlpage/templates/landing-page.handlebars)
7-
- The [migrations](./sqlpage/migrations) that populate the database with the documentation for all components
7+
- The [editable reference, examples, and articles](./content/) that populate the documentation
88
- The [advanced multistep form example](./examples/multistep-form/)
99

1010
It is hosted as a simple Docker container on [sql-page.com](https://sql-page.com).
@@ -21,6 +21,10 @@ Run SQLPage from that directory, or run
2121
`docker compose -f examples/official-site/docker-compose.yml up --build` from
2222
the repository root.
2323

24+
The builder writes one documentation migration and its search index. SQLPage
25+
loads it into in-memory SQLite at startup, along with the checked-in demo and
26+
installation migrations.
27+
2428
Add `theme=light` or `theme=dark` to a component reference URL to preview its
2529
live examples using SQLPage's stock theme. For example, visit
2630
`/component.sql?component=form&theme=light`.
@@ -49,8 +53,8 @@ name. Keep the argument list in signature order and mark mandatory arguments wit
4953
Component pages in `content/components/` list parameters under `top` and `row`.
5054
Each `examples/*.md` file can contain `rows` in its YAML metadata. These rows
5155
drive both the live preview and the copyable SQL. The Markdown body is the
52-
example caption. Use numbered filenames to keep the examples in order.
53-
References that have not moved still come from the SQL migrations.
56+
example caption. The numeric filename prefix is the public anchor: `04-embed.md` is `#example-4`.
57+
Keep existing numbers when adding or removing examples.
5458

5559
## Landing page
5660

‎examples/official-site/component.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ select 'dynamic' as component, json_array(
3434
case when result is not null then json_object('component', 'docs-example', 'end_result', true)
3535
else json_array() end
3636
) as properties
37-
from examples order by example_id;
37+
from examples order by example_number;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
- id: display-data
2+
title: Display data
3+
sort_order: 1
4+
- id: forms-and-feedback
5+
title: Forms and feedback
6+
sort_order: 2
7+
- id: navigation
8+
title: Navigation
9+
sort_order: 3
10+
- id: page-layout
11+
title: Page layout and content
12+
sort_order: 4
13+
- id: http-responses
14+
title: HTTP responses
15+
sort_order: 5
16+
- id: server-logic
17+
title: Server logic
18+
sort_order: 6
19+
- id: request-data
20+
title: Request data
21+
sort_order: 1
22+
- id: links-and-routing
23+
title: Links and routing
24+
sort_order: 2
25+
- id: files-and-uploads
26+
title: Files and uploads
27+
sort_order: 3
28+
- id: identity-and-security
29+
title: Identity and security
30+
sort_order: 4
31+
- id: external-services
32+
title: External services
33+
sort_order: 5
34+
- id: server-and-runtime
35+
title: Server and runtime
36+
sort_order: 6

‎examples/official-site/sqlpage/migrations/01_documentation.sql‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎examples/official-site/sqlpage/migrations/08_functions.sql‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎examples/official-site/sqlpage/migrations/12_blog.sql‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎examples/official-site/sqlpage/migrations/31_card_docs_update.sql‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎examples/official-site/sqlpage/migrations/62_example_cards.sql‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)