Quick reference for maintaining consistent documentation structure and style.
Journey-focused approach: User success > technical taxonomy. Structure guides users: Get Started → Build → Deploy, with supporting materials for deep understanding.
Core Principles: Progressive learning path, context-aware grouping, Diátaxis-informed, flat URLs, comprehensive redirects.
PRAGMATIC, NOT PEDANTIC: Serve users first. Mix content types if it helps. Keep install sections in how-tos if brief. Skip formalities when content is clear.
- Get Started - Entry point, sequential tutorials
- Build - Development workflows, pattern-based how-tos
- Deploy - Production operations, monitoring, maintenance
- Concepts - Mental models, architecture, flow definitions
- Reference - API docs, configuration, lookup info
- Tutorials - Complete real-world projects
- Comparisons - Technology selection support
Key Pattern: Filesystem = developer clarity, Navigation labels = user understanding, URLs = simple/memorable.
Example: src/content/docs/get-started/flows/ → Label: "Flows" → URL: /get-started/flows/create-flow/
Many nested navigation groups have flat URLs: Build > Writing Flows > Organize → /build/organize-flow-code/
NEST when:
- Platform-specific -
deploy/supabase/(future: cloudflare, aws) - Sequential series -
get-started/flows/,tutorials/ai-web-scraper/ - Alternative paths -
get-started/background-jobs/vsflows/ - Reference collections -
reference/configuration/,reference/queue-worker/ - Generic names -
starting-flows/typescript-client(avoids collision) - Needs overview page -
starting-flows/index.mdxcompares approaches
FLATTEN when:
- Conceptual groupings - "Writing Flows", "Observe" (may rename)
- Unique names -
organize-flow-code,monitor-execution - Future flexibility - Rename sidebar groups without breaking URLs
- Cross-cutting concerns - "APIs" (just admin grouping)
Rule: Nest if URL context helps users understand the page. Flatten if it's just sidebar organization.
Autogenerate for: Complete directories, sequential series, platform guides. Order via sidebar.order frontmatter.
Manual for: Conceptual groupings across flat files, nested nav without nested URLs, selective inclusion, custom labels.
Note: We don't use contentType in frontmatter. These are guidelines, not strict rules.
| Type | Structure | Tone | Depth | Key Features |
|---|---|---|---|---|
| Tutorial | 1. Context 2. Prerequisites 3. <Steps> 4. Next steps |
Direct ("Let's", "Now") | Step-by-step | Sequential, completion-focused |
| How-To | 1. Problem 2. Code 3. Explanation 4. Patterns | Instructional | Task-oriented | Multiple examples, OK to include brief setup |
| Concept | 1. Overview 2. Progressive 3. "Why" 4. Diagrams | Factual, neutral | 150-350 lines | Mental models, design transparency |
| Reference | 1. Hierarchy 2. Template 3. Tables 4. Examples | Terse (1-2 sentences) | 70-250 lines | Lookup, exhaustive, type-first |
Pragmatic Mixing OK:
- Brief installation/setup in how-to guides (< 50 lines)
- "When to use" sections in tutorials
- Code examples in concept docs
---
title: Brief, action-oriented title
description: One-line description focusing on outcome
sidebar:
order: 10 # Lower = higher in sidebar
---<Steps>
1. ### Step Title
Content here.
2. ### Next Step
More content.
</Steps>Note: Numbering is automatic; use H3 for titles.
:::caution[Prerequisites] # Yellow, for requirements
:::note[Key Concepts] # Blue, for info
:::tip[Pro Tip] # Green, for suggestions
:::danger[Prohibited Changes] # Red, for destructive ops```bash frame="none" # Commands (easy copy)
```typescript title="file.ts" # Files with titles
```diff lang="toml" # Config changes
```typescript {1-3,5} "term" # Line/string highlighting
```sql # Queries<Card title="..." icon="rocket">...</Card>
<CardGrid>
<LinkCard title="..." href="/path/" description="..." />
</CardGrid>Usage: End of tutorials (next steps), overview pages (grouped sections), within notes (related reading).
<FileTree>...</FileTree> # Directory structures
<Tabs><TabItem label="Before">...</TabItem></Tabs> # Comparisons
<details><summary>Read more</summary>...</details> # Collapsible content
import NotProductionReady from '@/components/NotProductionReady.astro';
import SecuritySetupWarning from '@/components/SecuritySetupWarning.astro';| Feature | Option A | Option B | # Comparison tables
| Parameter | Type | Required | Description | # API parameters
| Safe | Breaking | # Change classifications- Tutorials/How-tos: Use "you", present tense, action-oriented ("Let's", "Now")
- Concepts: Factual, neutral; avoid "we/our"; "you" only when instructing
- Examples: "Run the installer" vs "pgflow compiles flows into SQL"
- Bold for key concepts
Code formatfor technical terms, paths, variables- Inline links for references
- Paragraphs: 2-4 sentences, one idea each
- Lists: Bullets for related points, numbers for sequences
- Headings: H2 for sections, H3 for subsections, never H1 (from frontmatter)
- Title: Meaningful, not just "Overview" (e.g., "Choose your approach")
- Structure: Opening → H2 sections with CardGrids
- Examples:
/build/starting-flows/index.mdx(comparison),/build/index.mdx(overview)
:::caution[Prerequisites]
- Items with [links](/path/)
:::
## Next Steps / Where next?
<CardGrid><LinkCard ... /></CardGrid>- Top:
:::tipwith related link - Bottom: "Learn More" with CardGrid
- Inline: Essential prerequisites, technical terms
Pattern: kebab-case with action verbs (create-reusable-tasks.mdx, monitor-execution.mdx)
Avoid: Generic names (tasks.mdx), past tense (created-tasks.mdx)
Subdirectories for: Multiple pages on one topic, platform-specific content, tutorial series
sidebar:
order: 25 # Overview: none, Main: 10-50, Advanced: 50-100Link to prerequisites: Completed the [previous step](/path/)
:::danger- Destructive, data loss:::caution- Important but not destructive:::tip- Helpful optimizations
### Problem: Description
Code showing problem.
### Solution: How to fix
Code showing solution.
**Why this works**: Explanation.Show SQL results, command output after examples.
Always use trailing slashes: /path/ not /path (enforced by config)
Redirects in astro.config.mjs:
redirects: {
'/old-path/': '/new-path/',
}Add when moving existing pages (in main branch). Skip for new pages.
## Question as H2?
Short Answer: **Brief statement**
Context paragraph.
:::note
Related info or links.
:::
<details><summary>Read more</summary>
Extended explanation with H3 headings.
</details>Critical (must-have):
- Frontmatter: title, description, sidebar order
- No H1 (uses frontmatter)
- Trailing slashes on internal links
- Code blocks: proper language tags,
frame="none"for bash - File name: kebab-case, action verb
- Redirects if moving existing pages
- No special characters (em-dash, curly quotes, etc.)
- Correct terminology (pgflow not pgFlow, correct architecture terms)
Nice-to-have (context-dependent):
- Prerequisites:
:::caution(if complex prerequisites) - Sequential steps:
<Steps>(for tutorials) - Next steps: Cards/CardGrid (for longer docs)
- Tone matches type (be helpful, not rigid)
Never use: Em-dash (—), curly quotes/apostrophes ("" ' '), ellipsis (…), non-breaking spaces
Fix with: ./scripts/replace-special-chars.sh <file_path>
We are Diátaxis-INFORMED, not Diátaxis-COMPLIANT.
Navigation doesn't strictly match categories, but content aligns:
- Tutorials: Get Started, Tutorials (sequential, completion-focused)
- How-to: Build, Deploy (task-focused, multiple patterns)
- Explanation: Concepts, "Why" sections (mental models, rationale)
- Reference: Reference section (lookup tables, specifications)
What this means:
- No
contentTypein frontmatter (navigation structure implies type) - Content mixing is OK when it serves users
- Guidelines are tools, not laws
- User success > theoretical purity
- Journey-focused: Sections guide user progression
- Depth + discovery: Detailed pages with extensive cross-linking
- Consistent patterns: Predictable structure across types
- Progressive disclosure: Simple → advanced
- Multiple modalities: Code, diagrams, tables, prose
- URL stability: Redirects preserve historical links