Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions apps/docs/src/data/guidance-examples.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
export const guidanceExamples = [
{
label: "visual decision",
path: "pattern.crop-with-intent.md",
body: `---
for: Photography. Gather when a composition uses a photo.
materials:
- brand/photography/portrait.jpg
---

# Crop with intent

Crop around one clear subject. Let the subject meet at least one edge.

Reject cautious full-object framing and collages that avoid choosing a focal point.`,
palette: [],
},
{
label: "product pattern",
path: "condition.blocked-progress.md",
body: `---
for: Blocked progress. Gather when someone cannot continue a task.
materials:
- src/components/error-state/index.tsx
---

# Keep a path forward

Keep the explanation and one next action together.

If the person cannot resolve the problem, state what happens next. Do not end on a disabled control.`,
palette: [],
},
{
label: "exact material",
path: "asset.color-roles.md",
body: `---
for: Exact color roles and values. Gather before assigning color.
materials:
- src/styles/brand-tokens.css
---

# Color roles

Ink carries content. Signal marks selection. Correction marks review.

\`\`\`css
--ink: #171714;
--signal: #e8df55;
--correction: #c83e36;
\`\`\``,
palette: [
["ink", "#171714"],
["signal", "#e8df55"],
["correction", "#c83e36"],
],
},
] as const;
59 changes: 1 addition & 58 deletions apps/docs/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import DocSection from "@/components/DocSection.astro";
import { GatherDemo } from "@/components/docs/gather-demo";
import Hero from "@/components/Hero.astro";
import SectionWrapper from "@/components/SectionWrapper.astro";
import { guidanceExamples } from "@/data/guidance-examples";
import Base from "@/layouts/Base.astro";
const fragments = [
["product", "components, tokens, interaction patterns, UI copy"],
Expand Down Expand Up @@ -39,64 +40,6 @@ const steeringDiagnoses = [
},
] as const;

const guidanceExamples = [
{
label: "visual decision",
path: "pattern.crop-with-intent.md",
body: `---
for: Photography. Gather when a composition uses a photo.
materials:
- brand/photography/**
---

# Crop with intent

Crop around one clear subject. Let the subject meet at least one edge.

Reject cautious full-object framing and collages that avoid choosing a focal point.`,
palette: [],
},
{
label: "product pattern",
path: "condition.blocked-progress.md",
body: `---
for: Blocked progress. Gather when someone cannot continue a task.
materials:
- src/components/error-state/**
---

# Keep a path forward

Keep the explanation and one next action together.

If the person cannot resolve the problem, state what happens next. Do not end on a disabled control.`,
palette: [],
},
{
label: "exact material",
path: "asset.color-roles.md",
body: `---
for: Exact color roles and values. Gather before assigning color.
materials:
- src/styles/brand-tokens.css
---

# Color roles

Ink carries content. Signal marks selection. Correction marks review.

\`\`\`css
--ink: #171714;
--signal: #e8df55;
--correction: #c83e36;
\`\`\``,
palette: [
["ink", "#171714"],
["signal", "#e8df55"],
["correction", "#c83e36"],
],
},
] as const;

---

Expand Down
11 changes: 11 additions & 0 deletions packages/ghost/test/docs-examples.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { describe, expect, it } from "vitest";
import { guidanceExamples } from "../../../apps/docs/src/data/guidance-examples.js";
import { parseNode } from "../src/ghost-core/node/parse.js";

describe("rendered docs guidance examples", () => {
it.each(guidanceExamples)("$path parses without errors", ({ body }) => {
const { node, report } = parseNode(body);
expect(report.errors, JSON.stringify(report.issues)).toBe(0);
expect(node).not.toBeNull();
});
});
Loading