kitfly 0.2.1 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +38 -21
  3. package/VERSION +1 -1
  4. package/dist/_raw/content/guide/branding.md +146 -0
  5. package/dist/_raw/content/guide/data-driven-content.md +204 -0
  6. package/dist/_raw/content/reference/configuration.md +145 -7
  7. package/dist/_raw/content/reference/environment-variables.md +26 -1
  8. package/dist/_raw/content/reference/gantt-widget.md +468 -0
  9. package/dist/_raw/content/reference/glossary.md +25 -1
  10. package/dist/_raw/content/reference/key-concepts.md +30 -2
  11. package/dist/_raw/content/reference/plugins.md +170 -1
  12. package/dist/_raw/docs/decisions/ADR-0006-data-driven-content.md +350 -0
  13. package/dist/content/deployment/preflight.html +11 -8
  14. package/dist/content/deployment/recipes/aws-s3.html +11 -8
  15. package/dist/content/deployment/recipes/cloudflare-pages.html +11 -8
  16. package/dist/content/deployment/recipes/cloudflare-r2.html +11 -8
  17. package/dist/content/deployment/recipes/fly-io.html +11 -8
  18. package/dist/content/deployment/recipes/github-pages.html +11 -8
  19. package/dist/content/deployment/recipes/netlify.html +11 -8
  20. package/dist/content/deployment/recipes/vercel.html +11 -8
  21. package/dist/content/deployment/secrets-and-env-vars.html +11 -8
  22. package/dist/content/deployment.html +11 -8
  23. package/dist/content/guide/approaches.html +11 -8
  24. package/dist/content/guide/branding.html +509 -0
  25. package/dist/content/guide/data-driven-content.html +542 -0
  26. package/dist/content/guide/features.html +11 -8
  27. package/dist/content/guide/getting-started.html +11 -8
  28. package/dist/content/guide/kitfly-overview.html +11 -8
  29. package/dist/content/reference/configuration.html +136 -11
  30. package/dist/content/reference/design-catalog.html +11 -8
  31. package/dist/content/reference/environment-variables.html +51 -10
  32. package/dist/content/reference/gantt-widget.html +899 -0
  33. package/dist/content/reference/glossary.html +25 -10
  34. package/dist/content/reference/key-concepts.html +34 -11
  35. package/dist/content/reference/plugins.html +261 -10
  36. package/dist/content/reference/slides-authoring-guidelines.html +11 -8
  37. package/dist/content/reference/structure.html +11 -8
  38. package/dist/content/reference.html +11 -8
  39. package/dist/content/templates/crucible.html +11 -8
  40. package/dist/content/templates/handbook.html +11 -8
  41. package/dist/content/templates/minimal.html +11 -8
  42. package/dist/content/templates/overview.html +11 -8
  43. package/dist/content/templates/pipeline.html +11 -8
  44. package/dist/content/templates/productbook.html +11 -8
  45. package/dist/content/templates/runbook.html +11 -8
  46. package/dist/content/templates/servicebook.html +11 -8
  47. package/dist/content-index.json +37 -2
  48. package/dist/docs/decisions/ADR-0001-minimalist-site-code.html +11 -8
  49. package/dist/docs/decisions/ADR-0002-ai-accessibility.html +11 -8
  50. package/dist/docs/decisions/ADR-0003-single-file-bundle.html +11 -8
  51. package/dist/docs/decisions/ADR-0004-bun-runtime.html +11 -8
  52. package/dist/docs/decisions/ADR-0005-plugin-contract-and-distribution.html +11 -8
  53. package/dist/docs/decisions/ADR-0006-data-driven-content.html +751 -0
  54. package/dist/docs/decisions/DDR-0001-viewport-locked-layout.html +11 -8
  55. package/dist/docs/decisions/DDR-0002-theme-system.html +11 -8
  56. package/dist/docs/decisions/DDR-0003-bounded-logo-slot.html +11 -8
  57. package/dist/docs/decisions/DDR-0004-slides-rendering-model.html +11 -8
  58. package/dist/docs/decisions/DDR-0005-deterministic-layout-boundary.html +11 -8
  59. package/dist/docs/userguide/cli/build.html +11 -8
  60. package/dist/docs/userguide/cli/bundle.html +11 -8
  61. package/dist/docs/userguide/cli/dev.html +11 -8
  62. package/dist/docs/userguide/cli/init.html +11 -8
  63. package/dist/docs/userguide/cli/servers.html +11 -8
  64. package/dist/docs/userguide/cli/stop.html +11 -8
  65. package/dist/docs/userguide/cli/update.html +11 -8
  66. package/dist/docs/userguide/cli/version.html +11 -8
  67. package/dist/docs/userguide/cli.html +11 -8
  68. package/dist/docs/userguide/sharing.html +11 -8
  69. package/dist/index.html +11 -8
  70. package/dist/llms.txt +3 -3
  71. package/dist/provenance.json +4 -5
  72. package/dist/reports/license-inventory.csv +199 -0
  73. package/dist/schemas/plugin-registry.schema.html +11 -8
  74. package/dist/schemas/plugin-schemas-notes.html +11 -8
  75. package/dist/schemas/plugin.schema.html +11 -8
  76. package/dist/schemas/plugins.schema.html +11 -8
  77. package/dist/schemas/v0/common.schema.html +15 -12
  78. package/dist/schemas/v0/plugin-registry.schema.html +14 -11
  79. package/dist/schemas/v0/plugin.schema.html +14 -11
  80. package/dist/schemas/v0/plugins.schema.html +14 -11
  81. package/dist/schemas/v0/site.schema.html +68 -9
  82. package/dist/schemas/v0/theme.schema.html +22 -19
  83. package/dist/schemas.html +11 -8
  84. package/dist/styles.css +39 -4
  85. package/package.json +1 -1
  86. package/plugins-dist/latex-runtime.js +140 -0
  87. package/plugins-dist/latex.js +178 -0
  88. package/plugins-dist/planning-visuals.css +261 -0
  89. package/plugins-dist/planning-visuals.js +669 -0
  90. package/plugins-dist/slides-charts-lite-runtime.js +179 -0
  91. package/plugins-dist/slides-charts-lite.js +198 -0
  92. package/registry/plugins.yaml +40 -1
  93. package/schemas/v0/site.schema.json +56 -0
  94. package/scripts/build-all.ts +5 -0
  95. package/scripts/build.ts +264 -80
  96. package/scripts/bundle.ts +188 -17
  97. package/scripts/dev.ts +294 -171
  98. package/scripts/embed-docs.ts +119 -0
  99. package/src/__tests__/brief.test.ts +151 -0
  100. package/src/__tests__/build.test.ts +293 -1
  101. package/src/__tests__/bundle.test.ts +195 -0
  102. package/src/__tests__/docs.test.ts +117 -0
  103. package/src/__tests__/fixtures/fences/planning-visuals/invalid/bad-month-format.md +10 -0
  104. package/src/__tests__/fixtures/fences/planning-visuals/invalid/marker-format-mismatch.md +13 -0
  105. package/src/__tests__/fixtures/fences/planning-visuals/invalid/milestone-format-mismatch.md +13 -0
  106. package/src/__tests__/fixtures/fences/planning-visuals/invalid/missing-tracks.md +5 -0
  107. package/src/__tests__/fixtures/fences/planning-visuals/invalid/track-reversed.md +10 -0
  108. package/src/__tests__/fixtures/fences/planning-visuals/valid/markers-basic.md +15 -0
  109. package/src/__tests__/fixtures/fences/planning-visuals/valid/markers-no-milestones.md +13 -0
  110. package/src/__tests__/fixtures/fences/planning-visuals/valid/month-basic.md +16 -0
  111. package/src/__tests__/fixtures/fences/planning-visuals/valid/no-milestones.md +10 -0
  112. package/src/__tests__/fixtures/fences/planning-visuals/valid/week-basic.md +20 -0
  113. package/src/__tests__/init.test.ts +51 -2
  114. package/src/__tests__/latex-runtime.bun.test.ts +35 -0
  115. package/src/__tests__/planning-visuals-fence-contract.test.ts +28 -0
  116. package/src/__tests__/planning-visuals-runtime-regressions.bun.test.ts +68 -0
  117. package/src/__tests__/planning-visuals-runtime.bun.test.ts +192 -0
  118. package/src/__tests__/shared.test.ts +719 -1
  119. package/src/__tests__/slides-charts-lite-runtime.bun.test.ts +45 -0
  120. package/src/cli.ts +124 -22
  121. package/src/commands/docs.ts +71 -0
  122. package/src/commands/init.ts +1 -1
  123. package/src/generated/embedded-docs.ts +2384 -0
  124. package/src/server-registry.ts +50 -10
  125. package/src/shared.ts +1174 -43
  126. package/src/site/styles.css +39 -4
  127. package/src/site/template.html +5 -2
  128. package/src/templates/brief.ts +486 -0
  129. package/src/templates/deck.ts +59 -0
  130. package/src/templates/driver.ts +46 -13
  131. package/src/templates/handbook.ts +32 -0
  132. package/src/templates/runbook.ts +32 -0
@@ -0,0 +1,2384 @@
1
+ // AUTO-GENERATED by scripts/embed-docs.ts — do not edit
2
+ export const EMBEDDED_DOCS: ReadonlyArray<readonly [string, string, string]> = [
3
+ ["development", "Development Setup", `# Development Setup
4
+
5
+ How to set up a Kitfly development environment from a fresh clone.
6
+
7
+ ## Prerequisites
8
+
9
+ | Tool | Purpose | Install |
10
+ | ------------------------------------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----- |
11
+ | [Bun](https://bun.sh) | Runtime and package manager | macOS/Linux: \`curl -fsSL https://bun.sh/install \\| bash\`<br>Windows (PowerShell): \`powershell -c "irm https://bun.sh/install.ps1 | iex"\` |
12
+ | [GNU Make](https://www.gnu.org/software/make/) | Task runner | macOS: included with Xcode CLI tools<br>Linux: \`apt install make\`<br>Windows: \`scoop install make\` |
13
+ | [minisign](https://jedisct1.github.io/minisign/) | Signature verification (used by sfetch) | macOS: \`brew install minisign\`<br>Linux: \`apt install minisign\`<br>Windows: \`scoop install minisign\` |
14
+ | curl | HTTP client (bootstrap downloads) | macOS/Linux: usually pre-installed<br>Windows: available in PowerShell (\`Invoke-RestMethod\`) |
15
+
16
+ ## Windows notes (contributors)
17
+
18
+ Kitfly works well on Windows, but **shell choice matters** for development.
19
+
20
+ ### Recommended setup
21
+
22
+ - Use **Git Bash** (or MSYS2) for \`make\`-based workflows.
23
+ - Use **PowerShell** for installing Bun.
24
+
25
+ ### Install Bun (PowerShell)
26
+
27
+ \`\`\`powershell
28
+ powershell -c "irm https://bun.sh/install.ps1|iex"
29
+ \`\`\`
30
+
31
+ If VS Code’s default terminal is \`cmd.exe\`, you may need to restart VS Code (or ensure \`C:\\Users\\<you>\\.bun\\bin\` is on PATH).
32
+
33
+ ### Install prerequisites (Scoop)
34
+
35
+ If you don’t already have Scoop, install it from https://scoop.sh.
36
+
37
+ Then install the tools used by \`make bootstrap\`:
38
+
39
+ \`\`\`powershell
40
+ scoop install make minisign git
41
+ \`\`\`
42
+
43
+ ### Paths
44
+
45
+ Kitfly’s bootstrap tools install into \`~/.local/bin\`.
46
+
47
+ - In Git Bash, that’s the usual \`~/.local/bin\`.
48
+ - In Windows terms, it’s typically \`%USERPROFILE%\\.local\\bin\`.
49
+
50
+ Ensure that directory is on your PATH in the shell you use.
51
+
52
+ ## Quick Start
53
+
54
+ \`\`\`bash
55
+ git clone https://github.com/3leaps/kitfly
56
+ cd kitfly
57
+ make bootstrap
58
+ \`\`\`
59
+
60
+ \`make bootstrap\` installs the full toolchain in four steps:
61
+
62
+ 1. **sfetch** — secure download tool (trust anchor)
63
+ 2. **goneat** — formatting and linting tool (installed via sfetch)
64
+ 3. **Foundation tools** — standard tooling suite (installed via goneat)
65
+ 4. **Bun dependencies** — \`bun install\`
66
+
67
+ Tools are installed to \`~/.local/bin\`. Ensure this is on your PATH:
68
+
69
+ \`\`\`bash
70
+ export PATH="$HOME/.local/bin:$PATH"
71
+ \`\`\`
72
+
73
+ ## Verify
74
+
75
+ \`\`\`bash
76
+ make tools # Check all external tools are available
77
+ make dev # Start dev server at http://localhost:3333
78
+ \`\`\`
79
+
80
+ ## Quality gates (before a PR)
81
+
82
+ \`\`\`bash
83
+ make fmt
84
+ make check-all
85
+ \`\`\`
86
+
87
+ ## Daily Commands
88
+
89
+ | Command | What it does |
90
+ | ---------------- | -------------------------------------------------- |
91
+ | \`make dev\` | Dev server with hot reload |
92
+ | \`make build\` | Build static site to \`dist/\` |
93
+ | \`make bundle\` | Build single-file HTML bundle |
94
+ | \`make fmt\` | Format all code (Biome for TS, goneat for YAML/MD) |
95
+ | \`make test\` | Run test suite |
96
+ | \`make check-all\` | Full quality check (lint + typecheck + test) |
97
+ | \`make clean\` | Remove build artifacts |
98
+
99
+ ## Local CLI Install
100
+
101
+ To use the \`kitfly\` command from anywhere (dogfooding):
102
+
103
+ \`\`\`bash
104
+ make install
105
+ \`\`\`
106
+
107
+ On macOS/Linux, this symlinks \`src/cli.ts\` to \`~/.local/bin/kitfly\`.
108
+
109
+ On Windows (Git Bash/MSYS/MINGW), it installs a small launcher script instead of a symlink (symlinks often require admin/Developer Mode).
110
+
111
+ Remove with \`make uninstall\`.
112
+
113
+ ## Common gotchas
114
+
115
+ - If \`kitfly\` isn’t found after \`make install\`, ensure \`~/.local/bin\` is on your \`PATH\`.
116
+ - If port \`3333\` is already in use, run \`kitfly servers\` and \`kitfly stop 3333\` (or use \`--port\`).
117
+
118
+ ## Project Structure
119
+
120
+ \`\`\`
121
+ kitfly/
122
+ ├── src/ # Engine + CLI code
123
+ ├── scripts/ # Dev/build/bundle scripts (copied to users)
124
+ ├── content/ # Kitfly's own documentation (NOT copied)
125
+ ├── schemas/ # JSON schemas (copied to users)
126
+ ├── docs/ # Repo docs: decisions, this file
127
+ ├── AGENTS.md # AI agent guide
128
+ └── Makefile # All task automation
129
+ \`\`\`
130
+
131
+ See [AGENTS.md](../AGENTS.md) for the full architecture breakdown and coding guidelines.`],
132
+ ["guide/getting-started", "Getting Started", `# Getting Started
133
+
134
+ Get your documentation site running in under a minute.
135
+
136
+ ## The Site Root Concept
137
+
138
+ Kitfly always operates on a folder you point it at (the **site root**).
139
+
140
+ That folder typically contains:
141
+
142
+ - \`content/\` (or \`docs/\` or any folder you choose)
143
+ - \`site.yaml\` (recommended) for nav + branding
144
+ - \`theme.yaml\` (optional) for colors + typography
145
+
146
+ ## Create A New Site Root (Recommended)
147
+
148
+ \`\`\`bash
149
+ kitfly init my-docs
150
+ cd my-docs
151
+ kitfly dev
152
+ \`\`\`
153
+
154
+ Your browser opens to \`http://localhost:3333\` with hot reload.
155
+
156
+ ## Add Your Content
157
+
158
+ 1. **Delete the sample content:**
159
+
160
+ \`\`\`bash
161
+ rm -rf content/*
162
+ \`\`\`
163
+
164
+ 2. **Add your markdown files:**
165
+
166
+ \`\`\`bash
167
+ cp -r ~/my-docs/* content/
168
+ \`\`\`
169
+
170
+ 3. **Organize into sections:**
171
+
172
+ \`\`\`
173
+ content/
174
+ ├── index.md # Home page
175
+ ├── guide/ # Becomes "Guide" section
176
+ │ ├── quickstart.md
177
+ │ └── tutorial.md
178
+ └── reference/ # Becomes "Reference" section
179
+ └── api.md
180
+ \`\`\`
181
+
182
+ 4. **Preview:**
183
+ \`\`\`bash
184
+ bun run dev
185
+ \`\`\`
186
+
187
+ Subdirectories automatically become navigation sections. Files within them appear in the sidebar.
188
+
189
+ ## Share It
190
+
191
+ \`\`\`bash
192
+ kitfly build --out dist
193
+
194
+ # Single-file bundle (easiest to email/Slack)
195
+ kitfly bundle --out dist --name my-docs.html
196
+ \`\`\`
197
+
198
+ Output goes to \`dist/\`. You can:
199
+
200
+ - **Open directly:** \`open dist/index.html\`
201
+ - **Deploy anywhere:** GitHub Pages, Netlify, S3, any static host
202
+ - **Share as zip:** Compress and email for review
203
+
204
+ The static HTML works offline - no server required.
205
+
206
+ ## Frontmatter
207
+
208
+ Add metadata to your markdown files:
209
+
210
+ \`\`\`yaml
211
+ ---
212
+ title: "Page Title"
213
+ description: "Brief description"
214
+ last_updated: "2026-02-03"
215
+ ---
216
+ # Your Content Here
217
+ \`\`\`
218
+
219
+ - \`title\` - Appears in browser tab and header
220
+ - \`description\` - For meta tags
221
+ - \`last_updated\` - Shown in page footer
222
+
223
+ ## Next Steps
224
+
225
+ - [Approaches](approaches.html) - Understand the three ways to use kitfly
226
+ - [Kitfly Overview](kitfly-overview.html) - The big picture and workflows
227
+ - [Features](features.html) - See code highlighting, diagrams, and more
228
+ - [Configuration](../reference/configuration.html) - Customize \`site.yaml\`
229
+
230
+ ## Running From Source
231
+
232
+ If you're working on the Kitfly engine itself (this repo), you can run the CLI via Bun:
233
+
234
+ \`\`\`bash
235
+ bun install
236
+ bun run src/cli.ts dev .
237
+ \`\`\``],
238
+ ["guide/kitfly-overview", "Kitfly Overview", `# Kitfly Overview
239
+
240
+ Kitfly helps people who aren't web developers turn a folder of writing into something shareable:
241
+
242
+ - A **single-file HTML bundle** you can email or post in Slack
243
+ - A **static site folder** you can zip and host anywhere
244
+
245
+ It is intentionally small: one dependency (\`marked\`) and a codebase you can understand in an afternoon.
246
+
247
+ ## Mission
248
+
249
+ Many people have documentation that needs to be shared: runbooks, handbooks, project docs, technical guides. The options are often:
250
+
251
+ - **Too heavy**: Docusaurus, Hugo, Astro require learning build tooling
252
+ - **Too locked**: Notion, Confluence, GitBook require accounts and subscriptions
253
+ - **Too ugly**: Raw markdown or PDFs don't look professional
254
+
255
+ Kitfly sits in the gap: professional output, minimal complexity, no lock-in.
256
+
257
+ ## What Kitfly Is
258
+
259
+ - A renderer for markdown folders with a clean, professional default layout
260
+ - A fast way to preview docs locally (\`kitfly dev\`)
261
+ - A way to ship docs as artifacts (\`kitfly bundle\`, \`kitfly build\`)
262
+ - A tool that gives you **your own copy** of the rendering code
263
+
264
+ ## What Kitfly Is Not
265
+
266
+ Kitfly is not trying to replace full static site generators or app frameworks. These are excellent — use them when you need their power:
267
+
268
+ | Tool | Strength | Use When |
269
+ | ------------------- | ------------------------------- | ----------------------- |
270
+ | **Obsidian** | Personal knowledge, journaling | You need a second brain |
271
+ | **Docusaurus** | React ecosystem, versioned docs | You have a dev team |
272
+ | **Hugo** | Speed, themes, flexibility | You want a powerful SSG |
273
+ | **Astro/Starlight** | Modern, component-driven | You need interactivity |
274
+ | **VitePress** | Vue ecosystem, great DX | You're in the Vue world |
275
+
276
+ Use Kitfly when you don't need those. Your content is just markdown — migration is straightforward when you outgrow it.
277
+
278
+ ## Three Ways to Use Kitfly
279
+
280
+ ### 1. Create a Standalone Site (Primary Path)
281
+
282
+ \`\`\`bash
283
+ kitfly init my-docs
284
+ cd my-docs
285
+ bun install
286
+ bun run dev
287
+ \`\`\`
288
+
289
+ This creates a **complete, self-contained site** with:
290
+
291
+ \`\`\`
292
+ my-docs/
293
+ ├── .kitfly/ # Provenance metadata
294
+ │ └── manifest.json
295
+ ├── content/ # Your docs go here
296
+ ├── scripts/ # Rendering code (yours now)
297
+ │ ├── dev.ts
298
+ │ ├── build.ts
299
+ │ └── bundle.ts
300
+ ├── src/
301
+ │ ├── engine.ts
302
+ │ ├── theme.ts
303
+ │ └── site/
304
+ │ ├── template.html
305
+ │ └── styles.css
306
+ ├── schemas/
307
+ ├── site.yaml
308
+ ├── package.json # { "dependencies": { "marked": "^15" } }
309
+ └── VERSION # Provenance: created from kitfly 0.1.0
310
+ \`\`\`
311
+
312
+ **The site is detached from kitfly.** You own the code. You can:
313
+
314
+ - Modify the template, styles, rendering logic
315
+ - Version control the whole thing (\`git init\`)
316
+ - Never touch kitfly CLI again if you don't want to
317
+
318
+ **Best for:** New documentation projects, teams who want ownership.
319
+
320
+ ### 2. Point at Existing Docs (Quick Preview)
321
+
322
+ \`\`\`bash
323
+ kitfly dev ./my-existing-docs
324
+ kitfly build ./my-existing-docs --out ./dist
325
+ kitfly bundle ./my-existing-docs --name docs.html
326
+ \`\`\`
327
+
328
+ Renders any folder of markdown without copying anything into it.
329
+
330
+ **Best for:** Previewing docs that live in another repo, quick experiments.
331
+
332
+ ### 3. Clone the Kitfly Repo (Contributors)
333
+
334
+ \`\`\`bash
335
+ git clone https://github.com/3leaps/kitfly
336
+ cd kitfly
337
+ bun install
338
+ bun run dev
339
+ \`\`\`
340
+
341
+ This is the kitfly engine repo. The \`content/\` folder **is** the kitfly documentation — you're reading it now.
342
+
343
+ **Best for:** Contributing to kitfly, modifying the CLI, deep customization.
344
+
345
+ ## The "Fly" — How Docs Travel
346
+
347
+ Kitfly makes docs "fly" by producing artifacts that travel well:
348
+
349
+ | Command | Output | Use Case |
350
+ | --------------- | ---------------- | -------------------------- |
351
+ | \`kitfly dev\` | Live preview | Writing and editing |
352
+ | \`kitfly build\` | \`dist/\` folder | Deploy to any static host |
353
+ | \`kitfly bundle\` | Single HTML file | Email, Slack, shared drive |
354
+
355
+ The bundle is typically 1-2MB and works offline — open it in any browser.
356
+
357
+ ## Philosophy: Minimalist Site Code
358
+
359
+ The code that \`kitfly init\` copies to your project follows strict constraints:
360
+
361
+ | Metric | Target | Rationale |
362
+ | ------------ | ------ | ------------------------------ |
363
+ | Total lines | ~500 | Understandable in an afternoon |
364
+ | Dependencies | 1 | No supply chain risk |
365
+ | Files | ~10 | Nothing hidden |
366
+
367
+ > **Rule of thumb**: If it can be done with CSS, vanilla JS under 50 lines, or a marked plugin, it belongs. Otherwise, it doesn't.
368
+
369
+ This is codified in [ADR-0001: Minimalist Site Code](../../docs/decisions/ADR-0001-minimalist-site-code.md).
370
+
371
+ Users can modify the code — that's expected. But the starting point should be small enough that modification feels safe, not scary.
372
+
373
+ ## Provenance and Updates
374
+
375
+ When you run \`kitfly init\`, the site is stamped with provenance:
376
+
377
+ \`\`\`json
378
+ // .kitfly/manifest.json
379
+ {
380
+ "version": "0.1.0",
381
+ "createdAt": "2026-02-04T12:00:00Z",
382
+ "files": {
383
+ "scripts/dev.ts": { "hash": "a1b2c3", "managed": true },
384
+ ...
385
+ }
386
+ }
387
+ \`\`\`
388
+
389
+ This enables future updates:
390
+
391
+ \`\`\`bash
392
+ kitfly update # Upgrade to latest
393
+ kitfly update 0.2.0 # Upgrade to specific version
394
+ \`\`\`
395
+
396
+ The update logic:
397
+
398
+ 1. Read manifest → know current version
399
+ 2. For each managed file: check if user modified it (hash comparison)
400
+ 3. Safe to replace → update file
401
+ 4. User modified → warn, offer merge/skip/force
402
+ 5. Update manifest with new version
403
+
404
+ ## This Repo Is the Kitfly Docs
405
+
406
+ The \`content/\` folder in this repository is the actual kitfly documentation. When you run \`kitfly dev .\` here, you're seeing our docs rendered by our tool.
407
+
408
+ This means:
409
+
410
+ - **No fake showcase pages** — everything you see is real
411
+ - **Features are demonstrated by use** — Mermaid diagrams, code fences, theming
412
+ - **The docs are always current** — we eat our own cooking
413
+
414
+ ## Architecture Summary
415
+
416
+ \`\`\`
417
+ kitfly/ # The tool
418
+ ├── src/cli.ts # CLI entry (not copied to users)
419
+ ├── src/commands/ # init, update (not copied)
420
+ ├── content/ # Kitfly's own docs (not copied)
421
+
422
+ ├── scripts/ # ← Copied to user sites
423
+ │ ├── dev.ts
424
+ │ ├── build.ts
425
+ │ └── bundle.ts
426
+ ├── src/site/ # ← Copied to user sites
427
+ │ ├── template.html
428
+ │ └── styles.css
429
+ ├── src/engine.ts # ← Copied
430
+ ├── src/theme.ts # ← Copied
431
+ └── schemas/ # ← Copied
432
+ \`\`\`
433
+
434
+ **Kitfly the tool** can grow thoughtfully (more CLI commands, smarter updates). **Site code** stays minimal.
435
+
436
+ ## Next Steps
437
+
438
+ - [Getting Started](getting-started.md) — Set up your first site
439
+ - [Features](features.md) — See code highlighting, Mermaid diagrams, theming
440
+ - [Configuration](../reference/configuration.md) — Customize \`site.yaml\` and \`theme.yaml\``],
441
+ ["reference/configuration", "Configuration", `# Configuration
442
+
443
+ Kitfly uses \`site.yaml\` for configuration. Everything is optional - sensible defaults apply.
444
+
445
+ ## Quick Reference
446
+
447
+ \`\`\`yaml
448
+ # yaml-language-server: $schema=./schemas/v0/site.schema.json
449
+ schemaVersion: "0.1.0"
450
+ docroot: "content"
451
+ title: "My Documentation"
452
+ version: "2.4.1"
453
+ home: "index.md"
454
+
455
+ brand:
456
+ name: "My Project"
457
+ url: "https://myproject.com"
458
+ external: true
459
+
460
+ sections:
461
+ - name: "Guide"
462
+ path: "guide"
463
+ - name: "API"
464
+ path: "api"
465
+
466
+ footer:
467
+ copyright: "© 2026 My Project. All rights reserved."
468
+ links:
469
+ - text: "Privacy"
470
+ url: "/privacy"
471
+ - text: "Terms"
472
+ url: "/terms"
473
+ attribution: true
474
+ \`\`\`
475
+
476
+ ## Settings
477
+
478
+ ### docroot
479
+
480
+ **The most important setting.** Controls what folder contains your documentation.
481
+
482
+ \`\`\`yaml
483
+ docroot: "content"
484
+ \`\`\`
485
+
486
+ | Value | Meaning |
487
+ | ----------- | ------------------------------------------ |
488
+ | \`"content"\` | Markdown lives in \`content/\` (recommended) |
489
+ | \`"docs"\` | Markdown lives in \`docs/\` |
490
+ | \`"."\` | Markdown lives in repo root |
491
+
492
+ **Why it matters:** Only files under \`docroot\` appear in your built site. Everything else - \`src/\`, \`scripts/\`, \`README.md\`, \`package.json\` - stays out of \`dist/\`.
493
+
494
+ See [Folder Structure](structure.html) for details.
495
+
496
+ ### dataroot (v0.2.3+)
497
+
498
+ Data directory used for frontmatter \`data:\` bindings.
499
+
500
+ \`\`\`yaml
501
+ dataroot: "data"
502
+ \`\`\`
503
+
504
+ Default: \`data\`
505
+
506
+ \`dataroot\` must resolve inside the site root (no \`../\`, no absolute paths). Data files are loaded at build time and are not copied into output pages.
507
+
508
+ ### title
509
+
510
+ Site title. Appears in browser tab and header.
511
+
512
+ \`\`\`yaml
513
+ title: "My Documentation"
514
+ \`\`\`
515
+
516
+ ### version
517
+
518
+ Site/content version shown in the footer provenance zone.
519
+
520
+ \`\`\`yaml
521
+ version: "2.4.1"
522
+ \`\`\`
523
+
524
+ Version resolution order:
525
+
526
+ 1. \`site.yaml\` \`version\`
527
+ 2. Git tag on \`HEAD\` (exact match, \`v\` prefix removed)
528
+ 3. Omitted from footer provenance if neither is available
529
+
530
+ ### home
531
+
532
+ Home page file (relative to docroot). Becomes \`index.html\`.
533
+
534
+ \`\`\`yaml
535
+ home: "index.md"
536
+ \`\`\`
537
+
538
+ If omitted, the first file from the first section is used.
539
+
540
+ ### brand
541
+
542
+ Header branding:
543
+
544
+ \`\`\`yaml
545
+ brand:
546
+ name: "My Project" # Text in header
547
+ url: "/" # Logo link
548
+ logo: "assets/brand/my-logo.png" # Sidebar logo image
549
+ logoDark: "assets/brand/my-logo-dark.png" # Dark mode logo (optional)
550
+ favicon: "assets/brand/favicon-32.png" # Browser tab icon
551
+ external: true # Open in new tab (optional)
552
+ \`\`\`
553
+
554
+ When \`logoDark\` is set, kitfly shows it in dark mode instead of applying the default brightness filter. See the [Branding](/content/guide/branding) guide for details on dark mode variants.
555
+
556
+ The logo renders inside a bounded slot that preserves aspect ratio:
557
+
558
+ | Breakpoint | Max Height | Max Width |
559
+ | ---------------- | ---------- | --------- |
560
+ | Desktop | 64px | 180px |
561
+ | Tablet (≤1024px) | 56px | 150px |
562
+ | Mobile (≤768px) | 48px | 130px |
563
+
564
+ Both square marks and wide wordmarks fit cleanly. SVG and PNG formats are supported. For SVGs, ensure the \`viewBox\` is tightly cropped to the artwork — an oversized canvas will render the logo too small.
565
+
566
+ ### sections
567
+
568
+ Navigation structure. Each section becomes a sidebar group.
569
+
570
+ \`\`\`yaml
571
+ sections:
572
+ - name: "Guide" # Display name
573
+ path: "guide" # Directory (relative to docroot)
574
+ - name: "Reference"
575
+ path: "reference"
576
+ \`\`\`
577
+
578
+ **Auto-discovery:** If \`files\` is omitted, all \`.md\` files in the directory are included, recursively up to \`maxDepth\` levels deep.
579
+
580
+ \`\`\`yaml
581
+ sections:
582
+ - name: "Reference"
583
+ path: "reference"
584
+ maxDepth: 6 # Discover up to 6 levels deep (default: 4, max: 10)
585
+ \`\`\`
586
+
587
+ | Setting | Default | Range | Effect |
588
+ | ---------- | ------- | ----- | ------------------------------------------------- |
589
+ | \`maxDepth\` | 4 | 1–10 | How many directory levels to scan for \`.md\` files |
590
+
591
+ Deeper sections produce hierarchical sidebar navigation with collapsible groups. This applies to both docs and slides modes — slide decks with subfolder content get nested, collapsible nav while keeping \`#slide-N\` hash navigation. Set a lower \`maxDepth\` for sections where you want a flatter sidebar.
592
+
593
+ **Explicit files:** For precise control over which files appear (bypasses auto-discovery):
594
+
595
+ \`\`\`yaml
596
+ sections:
597
+ - name: "Overview"
598
+ path: "."
599
+ files: ["README.md", "CHANGELOG.md"]
600
+ \`\`\`
601
+
602
+ ### profiles (v0.2.3+)
603
+
604
+ Named content profiles for single-source multi-audience filtering.
605
+
606
+ \`\`\`yaml
607
+ profiles:
608
+ alpha:
609
+ description: "Includes alpha-tagged content"
610
+ include:
611
+ tags: ["alpha"]
612
+ beta:
613
+ description: "Includes beta-tagged content"
614
+ include:
615
+ tags: ["beta"]
616
+ \`\`\`
617
+
618
+ Activate a profile via CLI flag or environment variable:
619
+
620
+ \`\`\`bash
621
+ kitfly dev ./mysite --profile alpha
622
+ KITFLY_PROFILE=beta kitfly build ./mysite
623
+ \`\`\`
624
+
625
+ Files with a matching \`profile:\` frontmatter tag are included. Files without a \`profile:\` field are always included. Tagged files are excluded when no profile is active or when the active profile doesn't match.
626
+
627
+ Sites without \`profiles:\` in site.yaml are completely unaffected — adding the field has no effect until a profile is explicitly activated.
628
+
629
+ ### prebuild (v0.2.3+)
630
+
631
+ Run generator commands before \`dev\`, \`build\`, and \`bundle\`.
632
+
633
+ \`\`\`yaml
634
+ prebuild:
635
+ - command: "bun run scripts/generate-pricing-data.ts"
636
+ watch: ["data/raw/pricing-input.json"]
637
+ - command: "bun run scripts/generate-team-data.ts"
638
+ \`\`\`
639
+
640
+ Rules:
641
+
642
+ - Hooks run sequentially in declared order.
643
+ - Non-zero exit halts the command with hook stderr.
644
+ - In dev mode, \`watch:\` patterns re-run matching hooks on file changes.
645
+ - Kitfly sets \`KITFLY_SITE_ROOT\`, \`KITFLY_DATA_DIR\`, \`KITFLY_BUILD_MODE\`, and \`KITFLY_PROFILE\` (when active).
646
+
647
+ ### footer
648
+
649
+ Footer has three zones: provenance (left), copyright and links (center), and Kitfly attribution (right). Each field is independent — setting one does not affect the others.
650
+
651
+ \`\`\`
652
+ v0.1.1 · Published 2026-02-10 © 2026 Acme Inc. · acme.com Built with Kitfly
653
+ ← provenance (automatic) ← copyright + links (configurable) → ← attribution →
654
+ \`\`\`
655
+
656
+ | Field | Default | What it controls |
657
+ | -------------- | -------------------------------- | ----------------------------------------- |
658
+ | \`copyright\` | \`© {publish-year} {brand.name}\` | The copyright text in the center zone |
659
+ | \`copyrightUrl\` | _(none)_ | Makes the copyright text a clickable link |
660
+ | \`links\` | Your \`brand.url\` shown as a link | Links after the copyright text (max 10) |
661
+ | \`attribution\` | \`true\` | "Built with Kitfly" on the right |
662
+ | \`logo\` | _(none)_ | Image logo in the footer-left position |
663
+ | \`logoDark\` | _(none)_ | Dark mode variant of the footer logo |
664
+ | \`logoUrl\` | _(none)_ | Makes the footer logo a clickable link |
665
+ | \`logoAlt\` | Copyright text or brand name | Alt text for the footer logo |
666
+ | \`logoHeight\` | \`20\` | Max height of footer logo in pixels |
667
+
668
+ **Common case: product name differs from copyright holder.** The default copyright uses \`brand.name\`, which is your product title (shown in the header). If your legal entity is different, override it:
669
+
670
+ \`\`\`yaml
671
+ # brand.name is "Acme Productbook" — that's the product title
672
+ # but the copyright holder is the company
673
+ footer:
674
+ copyright: "© 2026 Acme, Inc."
675
+ \`\`\`
676
+
677
+ This changes only the copyright. The brand URL link and attribution are unaffected.
678
+
679
+ **Make the copyright clickable:**
680
+
681
+ \`\`\`yaml
682
+ footer:
683
+ copyright: "© 2026 3 Leaps, LLC"
684
+ copyrightUrl: "https://3leaps.net"
685
+ \`\`\`
686
+
687
+ When \`copyrightUrl\` is set, the copyright text becomes a link. When omitted, it renders as plain text.
688
+
689
+ **Full example with all options:**
690
+
691
+ \`\`\`yaml
692
+ footer:
693
+ copyright: "© 2026 My Company, Inc."
694
+ copyrightUrl: "https://mycompany.com"
695
+ links:
696
+ - text: "Privacy"
697
+ url: "/privacy"
698
+ - text: "Terms"
699
+ url: "/terms"
700
+ attribution: true
701
+ \`\`\`
702
+
703
+ When \`links\` is set, it replaces the default brand URL link. When \`links\` is omitted, your \`brand.url\` appears as a link (with the protocol stripped — \`https://acme.com\` displays as \`acme.com\`).
704
+
705
+ Set \`footer.attribution: false\` to remove the "Built with Kitfly" text from the footer entirely.
706
+
707
+ **Footer logo** — add an image to the footer ribbon (e.g. a parent company logo):
708
+
709
+ \`\`\`yaml
710
+ footer:
711
+ logo: "assets/brand/footer-logo.png"
712
+ logoDark: "assets/brand/footer-logo-dark.png"
713
+ logoUrl: "https://example.com"
714
+ logoAlt: "Example Corp"
715
+ logoHeight: 24
716
+ \`\`\`
717
+
718
+ The footer logo renders at the leading edge of the ribbon, before provenance info. All footer logo fields are optional — if \`logo\` is omitted, the footer renders as text only. See the [Branding](/content/guide/branding) guide for full details.
719
+
720
+ ### theme layout (\`theme.yaml\`)
721
+
722
+ \`theme.yaml\` can override layout variables, including sidebar width.
723
+
724
+ \`\`\`yaml
725
+ # theme.yaml
726
+ layout:
727
+ sidebarWidth: "320px"
728
+ \`\`\`
729
+
730
+ This sets \`--sidebar-width\` and applies to dev server, static builds, and bundles.
731
+
732
+ Recommended range: \`240px\` to \`400px\` depending on logo and nav label length.
733
+
734
+ ## Frontmatter
735
+
736
+ Each markdown file can have YAML frontmatter:
737
+
738
+ \`\`\`yaml
739
+ ---
740
+ title: "Page Title"
741
+ description: "Brief description for meta tags"
742
+ last_updated: "2026-02-03"
743
+ ---
744
+ # Content starts here
745
+ \`\`\`
746
+
747
+ | Field | Purpose |
748
+ | -------------- | ------------------------------------------------------------------- |
749
+ | \`title\` | Page title (overrides filename) |
750
+ | \`description\` | Meta description |
751
+ | \`last_updated\` | Shown in page footer |
752
+ | \`data\` | Data file for \`{{ key }}\` / \`{{ snippet:name }}\` bindings (v0.2.3+) |
753
+ | \`profile\` | Profile tag(s) for audience filtering (v0.2.3+) |
754
+
755
+ ### \`data\` frontmatter (v0.2.3+)
756
+
757
+ Bind a page to a data file for value substitution and snippet injection:
758
+
759
+ \`\`\`yaml
760
+ ---
761
+ title: "Pricing"
762
+ data: "data/pricing.yaml"
763
+ ---
764
+ \`\`\`
765
+
766
+ The \`data:\` path is relative to site root. The data file uses a structured format:
767
+
768
+ \`\`\`yaml
769
+ globals:
770
+ company: "Acme Corp"
771
+ baseline_rate: "200"
772
+
773
+ pages:
774
+ - path: content/product/pricing.md
775
+ inject:
776
+ hero: "Implementation and operating costs"
777
+ snippets:
778
+ - slot: pricing-table
779
+ content: |
780
+ | Tier | Price |
781
+ |------|-------|
782
+ | Basic | $10/mo |
783
+ \`\`\`
784
+
785
+ **Path convention:** \`pages[].path\` must be relative to site root including the \`content/\` prefix — e.g. \`content/product/pricing.md\`, not \`product/pricing.md\`.
786
+
787
+ In the markdown body, use \`{{ key }}\` for value substitution and \`{{ snippet:name }}\` for block injection. Formatters apply with pipe syntax: \`{{ baseline_rate | dollar }}\`. See the [Data-Driven Content](/content/guide/data-driven-content) guide for the full formatter reference and generator patterns.
788
+
789
+ Pages without \`data:\` frontmatter are completely unaffected — literal \`{{ }}\` text passes through as-is.
790
+
791
+ ### \`profile\` frontmatter (v0.2.3+)
792
+
793
+ Tag a file for profile-based filtering:
794
+
795
+ \`\`\`yaml
796
+ ---
797
+ title: "Engagement Timeline"
798
+ profile: alpha
799
+ ---
800
+ \`\`\`
801
+
802
+ Multiple profiles:
803
+
804
+ \`\`\`yaml
805
+ ---
806
+ title: "Shared Appendix"
807
+ profile: [alpha, beta]
808
+ ---
809
+ \`\`\`
810
+
811
+ Files without a \`profile:\` field are always included regardless of which profile is active. See \`profiles\` in Settings above.
812
+
813
+ ## No Configuration
814
+
815
+ If you don't create \`site.yaml\`, kitfly will:
816
+
817
+ 1. Look for \`content/\` directory
818
+ 2. Auto-discover sections from subdirectories
819
+ 3. Use default title ("Documentation") and branding
820
+
821
+ This means you can start with just markdown files and add \`site.yaml\` later.
822
+
823
+ ## Schema Validation
824
+
825
+ For editor autocomplete and validation, reference the schema:
826
+
827
+ \`\`\`yaml
828
+ # yaml-language-server: $schema=./schemas/v0/site.schema.json
829
+ \`\`\`
830
+
831
+ The schema is in \`schemas/v0/site.schema.json\`.`],
832
+ ["reference/environment-variables", "Environment Variables", `# Environment Variables
833
+
834
+ An environment variable is a named value your terminal (or hosting platform) provides to a command.
835
+
836
+ Examples:
837
+
838
+ - \`PORT=3333\`
839
+ - \`AWS_PROFILE=my-team\`
840
+ - \`NETLIFY_AUTH_TOKEN=...\`
841
+
842
+ ## Why they matter for deployment
843
+
844
+ Kitfly’s output is static. Deployment tools often need credentials, and environment variables are a common way to provide them without putting secrets in files.
845
+
846
+ Important: don’t commit secrets to git. See:
847
+
848
+ - [Deployment: Secrets and Environment Variables](../deployment/secrets-and-env-vars.html)
849
+
850
+ ## How to set an environment variable
851
+
852
+ ### macOS / Linux (bash, zsh)
853
+
854
+ Set for a single command:
855
+
856
+ \`\`\`bash
857
+ MY_VAR="hello" my-command
858
+ \`\`\`
859
+
860
+ Set for your current terminal session:
861
+
862
+ \`\`\`bash
863
+ export MY_VAR="hello"
864
+ my-command
865
+ \`\`\`
866
+
867
+ ### Windows (PowerShell)
868
+
869
+ Set for your current session:
870
+
871
+ \`\`\`powershell
872
+ $env:MY_VAR = "hello"
873
+ my-command
874
+ \`\`\`
875
+
876
+ ## \`.env\` files (optional)
877
+
878
+ Some tools can read a \`.env\` file.
879
+
880
+ If you use one:
881
+
882
+ - keep it local-only
883
+ - make sure it is gitignored
884
+ - consider adding a \`.env.example\` with placeholder values (safe to commit)
885
+
886
+ ## Kitfly environment variables (v0.2.3+)
887
+
888
+ ### \`KITFLY_PROFILE\`
889
+
890
+ Activate a content profile without the \`--profile\` CLI flag:
891
+
892
+ \`\`\`bash
893
+ KITFLY_PROFILE=alpha kitfly build ./mysite
894
+ \`\`\`
895
+
896
+ Equivalent to \`kitfly build ./mysite --profile alpha\`.
897
+
898
+ ### Pre-build hook variables
899
+
900
+ Kitfly sets these before running each \`prebuild:\` hook:
901
+
902
+ | Variable | Value | Example |
903
+ | ------------------- | ------------------------------- | --------------------------- |
904
+ | \`KITFLY_SITE_ROOT\` | Absolute path to kitsite root | \`/Users/me/my-docs\` |
905
+ | \`KITFLY_DATA_DIR\` | Data directory relative to root | \`data/\` |
906
+ | \`KITFLY_BUILD_MODE\` | Current build mode | \`dev\`, \`build\`, or \`bundle\` |
907
+ | \`KITFLY_PROFILE\` | Active content profile (if any) | \`alpha\` |
908
+
909
+ These allow generators to adapt behavior per build context — for example, a generator might skip expensive API calls in \`dev\` mode or produce different output per profile.
910
+
911
+ ## Quick troubleshooting
912
+
913
+ - If a command says a variable is missing, print it:
914
+ - macOS/Linux: \`echo "$MY_VAR"\`
915
+ - PowerShell: \`echo $env:MY_VAR\`
916
+ - If it prints empty, it’s not set in that shell session.`],
917
+ ["reference/key-concepts", "Key Concepts", `# Key Concepts
918
+
919
+ Kitfly is intentionally small. If you understand these concepts, you understand the whole tool.
920
+
921
+ ## Site root
922
+
923
+ Your “site root” is the folder you run commands from. It usually contains:
924
+
925
+ - \`site.yaml\`
926
+ - \`content/\` (your docs)
927
+
928
+ When you run \`kitfly dev\`, \`kitfly build\`, or \`kitfly bundle\`, you usually run them from your site root.
929
+
930
+ ## \`docroot\`
931
+
932
+ \`docroot\` is the folder Kitfly renders into a site.
933
+
934
+ In most projects:
935
+
936
+ - \`docroot: "content"\`
937
+
938
+ Think of \`docroot\` as “the folder I’m publishing”.
939
+
940
+ ## Sections
941
+
942
+ Sections are what you see in the left navigation. Each section maps to a folder.
943
+
944
+ In \`site.yaml\`, it looks like:
945
+
946
+ \`\`\`yaml
947
+ sections:
948
+ - name: "Guide"
949
+ path: "guide"
950
+ \`\`\`
951
+
952
+ If you point \`kitfly\` at a folder without a \`site.yaml\`, Kitfly can auto-discover sections from subfolders (handy for quick previews).
953
+
954
+ ## \`dist/\` (build output)
955
+
956
+ \`kitfly build\` produces a static site folder, commonly:
957
+
958
+ - \`dist/\`
959
+
960
+ You deploy by uploading/syncing \`dist/\` to a static host.
961
+
962
+ ## Build vs Bundle vs Dev
963
+
964
+ - **Dev** (\`kitfly dev\`) is for writing: it runs a local server and reloads when files change.
965
+ - **Build** (\`kitfly build\`) is for hosting: it creates a \`dist/\` folder you can upload.
966
+ - **Bundle** (\`kitfly bundle\`) is for sending: it creates a single HTML file you can email or drop in Slack.
967
+
968
+ ## Build vs Bundle
969
+
970
+ - **Build**: outputs a folder (\`dist/\`) with multiple files (HTML + assets).
971
+ - **Bundle**: outputs a single HTML file you can email or upload (offline-friendly).
972
+
973
+ ## Markdown + frontmatter
974
+
975
+ Kitfly renders Markdown files (\`.md\`). You can optionally add YAML frontmatter at the top of a file:
976
+
977
+ \`\`\`yaml
978
+ ---
979
+ title: "My Page"
980
+ description: "What this page is about"
981
+ ---
982
+ \`\`\`
983
+
984
+ Frontmatter is the easiest way to control titles and add metadata without changing your headings.
985
+
986
+ ## Theme (\`theme.yaml\`)
987
+
988
+ Kitfly themes control the look of your site (colors, typography, layout details). The defaults are meant to be clean and readable.
989
+
990
+ If you don’t want to think about design: don’t touch it.
991
+
992
+ If you do: \`theme.yaml\` is your main “make it mine” knob.
993
+
994
+ ## Modes: docs vs slides (v0.2.0+)
995
+
996
+ Kitfly can render the same Markdown content in two layouts:
997
+
998
+ - **docs** (default): scrolling pages optimized for reading
999
+ - **slides**: fixed-aspect "one page at a time" slides with keyboard navigation
1000
+
1001
+ Slides mode is configured in \`site.yaml\`:
1002
+
1003
+ \`\`\`yaml
1004
+ mode: slides
1005
+ aspect: "16/9"
1006
+ \`\`\`
1007
+
1008
+ In both modes, organizing content into subfolders produces hierarchical sidebar navigation with collapsible groups. In slides mode, the nav links remain \`#slide-N\` hash anchors — the tree structure is visual grouping only.
1009
+
1010
+ ## Assets
1011
+
1012
+ Kitfly will serve and bundle common “content-adjacent” assets referenced from Markdown, like images and PDFs.
1013
+
1014
+ Rule of thumb: if it lives next to your docs, Kitfly tries to do the right thing.
1015
+
1016
+ ## Content profiles (v0.2.3+)
1017
+
1018
+ Profiles let you produce multiple audience-specific outputs from a single kitsite. Tag files with \`profile:\` in frontmatter and activate a profile via \`--profile\` flag or \`KITFLY_PROFILE\` env var.
1019
+
1020
+ - Files without \`profile:\` are always included (the common case).
1021
+ - Tagged files only appear when their profile is active.
1022
+ - No active profile = only untagged content.
1023
+
1024
+ This is a startup parameter, not a runtime toggle — changing profiles requires restarting the dev server.
1025
+
1026
+ ## Data bindings (v0.2.3+)
1027
+
1028
+ A page can opt into build-time bindings by setting \`data:\` in frontmatter.
1029
+
1030
+ - \`{{ key }}\` resolves scalar values from a data file.
1031
+ - \`{{ snippet:name }}\` injects a named markdown block.
1032
+ - Formatters like \`dollar\`, \`number\`, \`percent\`, \`round(n)\`, \`upper\`, \`lower\` apply with pipe syntax.
1033
+
1034
+ No loops/conditionals are supported in bindings. If you need logic, use a generator script and write data files before render.
1035
+
1036
+ ## Pre-build hooks (v0.2.3+)
1037
+
1038
+ \`prebuild:\` commands in \`site.yaml\` run before \`dev\`, \`build\`, and \`bundle\`.
1039
+
1040
+ Use hooks for generators (CSV/API/etc. to \`data/*.yaml\` or \`data/*.json\`). In dev mode, hook \`watch:\` patterns can re-run hooks when source files change.
1041
+
1042
+ ## Provenance
1043
+
1044
+ Kitfly can emit provenance information (version/build date/git info) so you can answer “what did we ship?”.
1045
+
1046
+ If you see “unversioned”, it usually means your site didn’t set a \`version\` in \`site.yaml\` and the current git commit isn’t exactly tagged.
1047
+
1048
+ ## “Static site” (plain language)
1049
+
1050
+ A static site is just files. No server-side database, no login, no runtime code required.
1051
+
1052
+ That’s why Kitfly sites are easy to:
1053
+
1054
+ - host almost anywhere
1055
+ - email as an attachment (bundle)
1056
+ - keep offline`],
1057
+ ["reference/plugins", "Plugins", `# Plugins
1058
+
1059
+ Kitfly plugins are small, optional add-ons that inject CSS and/or JS into your generated HTML.
1060
+
1061
+ They are designed to stay minimal:
1062
+
1063
+ - No build pipeline required
1064
+ - Offline-friendly when assets are local
1065
+ - You own the files (standalone sites copy \`registry/\` + \`plugins-dist/\`)
1066
+
1067
+ ## Enable a plugin
1068
+
1069
+ Create \`kitfly.plugins.yaml\` in your site root:
1070
+
1071
+ \`\`\`yaml
1072
+ # yaml-language-server: $schema=./schemas/v0/plugins.schema.json
1073
+ plugins:
1074
+ - callouts@0.2.0
1075
+ \`\`\`
1076
+
1077
+ Canonical plugins are referenced as pinned strings: \`name@x.y.z\`.
1078
+
1079
+ ### Canonical plugins (v0.2.4)
1080
+
1081
+ - \`callouts@0.2.0\` - styled NOTE/TIP/INFO/WARNING/DANGER blockquotes
1082
+ - \`slides-visuals@0.2.1\` - slide widgets + figures via \`:::\` blocks (\`slides\` mode only)
1083
+ - \`latex@0.2.2\` - KaTeX math rendering for \`$...$\`, \`$$...$$\`, and fenced \`math\` blocks
1084
+ - \`slides-charts-lite@0.2.2\` - bar/line/pie charts from fenced \`chart\` blocks (\`slides\` mode only)
1085
+ - \`planning-visuals@0.2.4\` - gantt planning widget via \`:::gantt\` blocks (\`docs\` and \`slides\`)
1086
+
1087
+ Example:
1088
+
1089
+ \`\`\`yaml
1090
+ plugins:
1091
+ - latex@0.2.2
1092
+ \`\`\`
1093
+
1094
+ ## Registry + assets
1095
+
1096
+ Canonical plugins come from a registry file:
1097
+
1098
+ - Site registry: \`registry/plugins.yaml\` (preferred if present)
1099
+ - Engine registry: used as a fallback when the site does not include a registry
1100
+
1101
+ Registry entries map a plugin id + version to asset locations (\`assets.js\` and/or \`assets.css\`) and per-asset checksums (\`assetSha256\`).
1102
+
1103
+ For local/offline registries, \`baseUrl\` may be an empty string.
1104
+
1105
+ ## Mode allowlist (\`modes\`)
1106
+
1107
+ Registry entries may include an optional \`modes\` allowlist to control where a plugin runs:
1108
+
1109
+ - Omitted: allowed in \`docs\` and \`slides\`
1110
+ - Present with values: allowed only in those modes (example: \`["slides"]\`)
1111
+ - Present but empty (\`[]\`): blocked in all modes (quick disable switch)
1112
+
1113
+ Example:
1114
+
1115
+ \`\`\`yaml
1116
+ plugins:
1117
+ slides-widgets:
1118
+ version: "0.2.0"
1119
+ modes: ["slides"]
1120
+ assets:
1121
+ js: "plugins-dist/slides-widgets.js"
1122
+ assetSha256:
1123
+ js: "sha256:..."
1124
+ \`\`\`
1125
+
1126
+ ## Integrity checks
1127
+
1128
+ Kitfly verifies every enabled asset against its \`sha256:<hex>\` checksum. If a checksum does not match, the build/dev server fails with an integrity error.
1129
+
1130
+ When iterating on a local plugin (for example, editing \`plugins-dist/slides-visuals.js\`), you must also update the matching \`assetSha256\` in \`registry/plugins.yaml\` (or disable the plugin) for Kitfly to load it.
1131
+
1132
+ ## Triple-colon fence contract (\`slides-visuals\`)
1133
+
1134
+ The \`slides-visuals\` plugin adds a \`:::\` block syntax for slides mode (widgets + figures).
1135
+
1136
+ To keep authoring predictable and make errors actionable, Kitfly defines a strict contract for these blocks.
1137
+ When \`slides-visuals\` is enabled, Kitfly validates blocks before rendering and reports contract violations.
1138
+
1139
+ ### Valid block shape
1140
+
1141
+ - Opening fence: \`:::<type>\` **must** start at column 0 and be the only content on the line.
1142
+ - Closing fence: \`:::\` **must** start at column 0 and be the only content on the line.
1143
+ - No blank lines inside a \`:::\` block.
1144
+ - Content is a narrow YAML subset:
1145
+ - Scalar: \`key: value\`
1146
+ - List: \`key:\` followed by list items
1147
+ - List item start: exactly two spaces, then \`- \` (example: \`␠␠- label: Users\`)
1148
+ - Continuation lines (object fields): exactly four spaces, then \`field: value\`
1149
+
1150
+ ### Supported types
1151
+
1152
+ Widgets:
1153
+
1154
+ - \`kpi\` (scalar keys: \`label\`, \`value\`, optional \`trend\`)
1155
+ - \`stat-grid\` (list key: \`metrics\` of \`{label,value,trend?}\` objects)
1156
+ - \`compare\` (scalar keys: \`left-title\`, \`right-title\`; list keys: \`left\`, \`right\` as **strings only**)
1157
+
1158
+ Notes:
1159
+
1160
+ - \`compare.left\` and \`compare.right\` items are simple strings (not \`{label: ..., value: ...}\` objects).
1161
+ - If you need multi-field items, use \`stat-grid\` / \`scorecard\` instead.
1162
+ - If an item contains a colon (\`:\`), quote it as a string.
1163
+
1164
+ Figures:
1165
+
1166
+ - \`quadrant-grid\` (scalar keys: \`axis-x\`, \`axis-y\`, \`tl\`, \`tr\`, \`bl\`, \`br\`)
1167
+ - \`scorecard\` (list key: \`metrics\` of \`{label,value,trend?}\` objects)
1168
+ - \`comparison-table\` (list keys: \`headers\` (strings), \`rows\` (strings))
1169
+ - \`layer-cake\` (list key: \`layers\` (strings))
1170
+ - \`pyramid\` (list key: \`levels\` (strings))
1171
+ - \`funnel\` (list key: \`stages\` (strings))
1172
+
1173
+ ### Example (valid)
1174
+
1175
+ \`\`\`markdown
1176
+ :::stat-grid
1177
+ metrics:
1178
+
1179
+ - label: Users
1180
+ value: 1,234
1181
+ - label: Uptime
1182
+ value: 99.95%
1183
+ trend: +0.3%
1184
+ :::
1185
+ \`\`\`
1186
+
1187
+ ### How to know it’s correct
1188
+
1189
+ When \`slides-visuals@...\` is enabled, Kitfly validates your \`:::\` blocks before it renders pages.
1190
+
1191
+ You know your fences are valid if:
1192
+
1193
+ - \`kitfly dev\` starts successfully, and pages load normally
1194
+ - \`kitfly build\` completes successfully
1195
+ - \`kitfly bundle\` completes successfully
1196
+
1197
+ If a block is invalid, Kitfly will fail fast with an error that points to the file and the specific contract rule you violated.
1198
+
1199
+ ### Common mistakes (and how to fix them)
1200
+
1201
+ - **Indented fences**: \`:::kpi\` must start at column 0 (no spaces, no list indentation, no blockquote \`>\`).
1202
+ - **Blank lines inside the block**: remove empty lines between keys/items.
1203
+ - **Wrong list indentation**:
1204
+ - list items must start with exactly two spaces then \`- \`
1205
+ - fields under an item must use exactly four spaces
1206
+ - **Unknown type**: the opening fence \`:::<type>\` must be one of the supported types.
1207
+
1208
+ ### Examples (invalid → fixed)
1209
+
1210
+ #### 1) Indented fence (invalid)
1211
+
1212
+ \`\`\`markdown
1213
+ :::kpi
1214
+ label: Users
1215
+ value: 1,234
1216
+ :::
1217
+ \`\`\`
1218
+
1219
+ Fixed:
1220
+
1221
+ \`\`\`markdown
1222
+ :::kpi
1223
+ label: Users
1224
+ value: 1,234
1225
+ :::
1226
+ \`\`\`
1227
+
1228
+ #### 2) Blank line inside block (invalid)
1229
+
1230
+ \`\`\`markdown
1231
+ :::kpi
1232
+ label: Users
1233
+
1234
+ value: 1,234
1235
+ :::
1236
+ \`\`\`
1237
+
1238
+ Fixed:
1239
+
1240
+ \`\`\`markdown
1241
+ :::kpi
1242
+ label: Users
1243
+ value: 1,234
1244
+ :::
1245
+ \`\`\`
1246
+
1247
+ #### 3) Bad list indentation (invalid)
1248
+
1249
+ \`\`\`markdown
1250
+ :::stat-grid
1251
+ metrics:
1252
+
1253
+ - label: Users
1254
+ value: 1,234
1255
+ :::
1256
+ \`\`\`
1257
+
1258
+ Fixed:
1259
+
1260
+ \`\`\`markdown
1261
+ :::stat-grid
1262
+ metrics:
1263
+
1264
+ - label: Users
1265
+ value: 1,234
1266
+ :::
1267
+ \`\`\`
1268
+
1269
+ #### 4) Unknown type (invalid)
1270
+
1271
+ \`\`\`markdown
1272
+ :::stats
1273
+ label: Users
1274
+ value: 1,234
1275
+ :::
1276
+ \`\`\`
1277
+
1278
+ Fixed: use a supported type (for example \`kpi\`):
1279
+
1280
+ \`\`\`markdown
1281
+ :::kpi
1282
+ label: Users
1283
+ value: 1,234
1284
+ :::
1285
+ \`\`\`
1286
+
1287
+ ## Triple-colon fence contract (\`planning-visuals\`)
1288
+
1289
+ The \`planning-visuals\` plugin adds a \`:::gantt\` block for planning and timeline visualization. Unlike \`slides-visuals\`, it works in both \`docs\` and \`slides\` mode.
1290
+
1291
+ Enable it in \`kitfly.plugins.yaml\`:
1292
+
1293
+ \`\`\`yaml
1294
+ plugins:
1295
+ - planning-visuals@0.2.4
1296
+ \`\`\`
1297
+
1298
+ ### Supported type
1299
+
1300
+ - \`gantt\` — horizontal bar chart on a shared time axis with hierarchical depth control
1301
+
1302
+ ### Chart-level parameters
1303
+
1304
+ | Parameter | Required | Description |
1305
+ | ------------ | -------- | --------------------------------------------------- |
1306
+ | \`time-unit\` | yes | Axis granularity: \`week\` or \`month\` |
1307
+ | \`time-start\` | yes | Left edge. \`YYYY-Www\` for week, \`YYYY-MM\` for month |
1308
+ | \`time-end\` | yes | Right edge. Same format as \`time-start\` |
1309
+ | \`label\` | no | Chart title, rendered above the time axis |
1310
+ | \`max-depth\` | no | Maximum depth to render. \`1\` = top-level only |
1311
+ | \`max-tracks\` | no | Maximum rendered rows. Excess shows "+N more" |
1312
+ | \`today\` | no | Renders a vertical dashed marker at this date |
1313
+
1314
+ ### Track fields
1315
+
1316
+ Tracks are horizontal bars spanning a start-to-end range.
1317
+
1318
+ | Field | Required | Default | Description |
1319
+ | -------- | -------- | --------- | --------------------------------------------- |
1320
+ | \`label\` | yes | — | Track label in the left column |
1321
+ | \`depth\` | yes | — | Hierarchy level: 1, 2, or 3 |
1322
+ | \`start\` | yes | — | Bar start (format must match \`time-unit\`) |
1323
+ | \`end\` | yes | — | Bar end (format must match \`time-unit\`) |
1324
+ | \`status\` | no | \`planned\` | \`planned\`, \`active\`, \`complete\`, or \`blocked\` |
1325
+
1326
+ ### Milestone fields
1327
+
1328
+ Milestones are point-in-time markers (diamond icon, not a bar). Listed separately from tracks.
1329
+
1330
+ | Field | Required | Default | Description |
1331
+ | ------- | -------- | ------- | ------------------------------------------------- |
1332
+ | \`label\` | yes | — | Milestone label in the left column |
1333
+ | \`date\` | yes | — | Single date (format must match \`time-unit\`) |
1334
+ | \`depth\` | no | 1 | Hierarchy level, subject to \`max-depth\` filtering |
1335
+
1336
+ ### Marker fields
1337
+
1338
+ Markers are chart-level vertical annotation lines spanning the full chart height, with a label at the top. Use them for gates, deadlines, and phase boundaries. Not subject to \`max-depth\` or \`max-tracks\` filtering.
1339
+
1340
+ | Field | Required | Description |
1341
+ | ------- | -------- | ------------------------------------------------------------- |
1342
+ | \`label\` | yes | Annotation text (~20 chars recommended). Truncated if longer. |
1343
+ | \`date\` | yes | Position on axis (format must match \`time-unit\`) |
1344
+ | \`color\` | no | Marker color (\`#hex\`, \`rgb\`, named color, or CSS variable) |
1345
+
1346
+ Markers with dates outside the axis range produce a build-time warning and are not rendered.
1347
+
1348
+ ### Row ordering
1349
+
1350
+ Tracks and milestones render in **source order** — the order you write them in the fence controls the visual sequence. You can interleave tracks and milestones freely.
1351
+
1352
+ ### Example (week mode)
1353
+
1354
+ \`\`\`markdown
1355
+ :::gantt
1356
+ label: "Platform Migration — 2026"
1357
+ time-unit: week
1358
+ time-start: "2026-W14"
1359
+ time-end: "2026-W30"
1360
+ max-depth: 2
1361
+ today: "2026-W20"
1362
+ tracks:
1363
+
1364
+ - label: "Phase 1 — Foundation"
1365
+ depth: 1
1366
+ start: "2026-W14"
1367
+ end: "2026-W22"
1368
+ status: active
1369
+ - label: "Auth Service"
1370
+ depth: 2
1371
+ start: "2026-W14"
1372
+ end: "2026-W18"
1373
+ status: complete
1374
+ - label: "Data Layer"
1375
+ depth: 2
1376
+ start: "2026-W17"
1377
+ end: "2026-W22"
1378
+ status: active
1379
+ milestones:
1380
+ - label: "Architecture Review"
1381
+ date: "2026-W16"
1382
+ - label: "Phase 1 Sign-Off"
1383
+ date: "2026-W23"
1384
+ depth: 2
1385
+ tracks:
1386
+ - label: "Phase 2 — Integration"
1387
+ depth: 1
1388
+ start: "2026-W24"
1389
+ end: "2026-W30"
1390
+ status: planned
1391
+ :::
1392
+ \`\`\`
1393
+
1394
+ ### Example (month mode)
1395
+
1396
+ \`\`\`markdown
1397
+ :::gantt
1398
+ label: "Product Roadmap — H2 2026"
1399
+ time-unit: month
1400
+ time-start: "2026-07"
1401
+ time-end: "2027-01"
1402
+ tracks:
1403
+
1404
+ - label: "Beta Program"
1405
+ depth: 1
1406
+ start: "2026-07"
1407
+ end: "2026-09"
1408
+ status: active
1409
+ - label: "GA Release"
1410
+ depth: 1
1411
+ start: "2026-10"
1412
+ end: "2026-12"
1413
+ status: planned
1414
+ milestones:
1415
+ - label: "Launch Event"
1416
+ date: "2026-10"
1417
+ :::
1418
+ \`\`\`
1419
+
1420
+ ### Depth filtering
1421
+
1422
+ The same data can drive a summary view and a detail view using \`max-depth\`:
1423
+
1424
+ - \`max-depth: 1\` renders only depth-1 bars and milestones (wave/phase level)
1425
+ - \`max-depth: 2\` adds depth-2 items (individual workstreams)
1426
+ - Omitting \`max-depth\` shows everything
1427
+
1428
+ ### Validation
1429
+
1430
+ When \`planning-visuals\` is enabled, Kitfly validates \`:::gantt\` blocks at build time:
1431
+
1432
+ - Missing \`time-unit\`, \`time-start\`, \`time-end\`, or \`tracks\` is a build error
1433
+ - Tracks missing \`label\`, \`depth\`, \`start\`, or \`end\` is a build error
1434
+ - Milestones missing \`label\` or \`date\` is a build error
1435
+ - Date format must match \`time-unit\` (\`YYYY-Www\` for week, \`YYYY-MM\` for month)
1436
+ - \`time-start\` must be before \`time-end\`; track \`start\` must be before or equal to \`end\`
1437
+ - Milestones are optional — a gantt with no \`milestones:\` list is valid
1438
+
1439
+ See [Gantt Widget Examples](gantt-widget.md) for more patterns.`],
1440
+ ["reference/structure", "Folder Structure", `# Folder Structure
1441
+
1442
+ Understanding what's in the template and what ends up in your built site.
1443
+
1444
+ ## Template Repository
1445
+
1446
+ When you clone kitfly, you get:
1447
+
1448
+ \`\`\`
1449
+ kitfly/
1450
+ ├── content/ # YOUR DOCS
1451
+ │ ├── index.md # Home page
1452
+ │ ├── guide/ # Guide section
1453
+ │ └── reference/ # Reference section
1454
+
1455
+ ├── src/ # RENDERING MACHINERY
1456
+ │ ├── cli.ts # CLI entry point
1457
+ │ ├── commands/ # CLI commands
1458
+ │ └── site/ # HTML template + CSS
1459
+
1460
+ ├── scripts/ # BUILD SCRIPTS
1461
+ │ ├── dev.ts # Dev server
1462
+ │ └── build.ts # Static build
1463
+
1464
+ ├── assets/ # BRAND ASSETS
1465
+ │ └── brand/ # Logo, favicon
1466
+
1467
+ ├── dist/ # BUILD OUTPUT (gitignored)
1468
+
1469
+ ├── .plans/ # PLANNING (gitignored)
1470
+
1471
+ ├── site.yaml # CONFIGURATION
1472
+ ├── package.json # Dependencies
1473
+ ├── VERSION # Version number
1474
+ ├── README.md # GitHub readme
1475
+ ├── AGENTS.md # AI agent guide
1476
+ └── LICENSE # MIT license
1477
+ \`\`\`
1478
+
1479
+ ## What Gets Built
1480
+
1481
+ When you run \`bun run build\`, **only content from \`docroot\` goes into \`dist/\`**:
1482
+
1483
+ \`\`\`
1484
+ dist/
1485
+ ├── index.html # From content/index.md
1486
+ ├── guide/
1487
+ │ ├── index.html # Redirect to first file
1488
+ │ ├── approaches.html # From content/guide/approaches.md
1489
+ │ ├── getting-started.html
1490
+ │ └── features.html
1491
+ ├── reference/
1492
+ │ ├── index.html # Redirect to first file
1493
+ │ ├── configuration.html
1494
+ │ └── structure.html
1495
+ ├── styles.css # From src/site/styles.css
1496
+ ├── provenance.json # Build metadata
1497
+ └── assets/ # Copied from assets/
1498
+ └── brand/
1499
+ \`\`\`
1500
+
1501
+ **Not in dist/:**
1502
+
1503
+ - \`src/\` - rendering code
1504
+ - \`scripts/\` - build scripts
1505
+ - \`README.md\` - GitHub readme
1506
+ - \`AGENTS.md\` - AI guide
1507
+ - \`package.json\` - dependencies
1508
+ - \`.plans/\` - planning files
1509
+ - Any other repo files
1510
+
1511
+ This separation is intentional. Your built site is just documentation - no tooling artifacts.
1512
+
1513
+ ## The docroot Setting
1514
+
1515
+ In \`site.yaml\`:
1516
+
1517
+ \`\`\`yaml
1518
+ docroot: "content"
1519
+ \`\`\`
1520
+
1521
+ This tells kitfly where to look for markdown files. Options:
1522
+
1523
+ | Setting | Effect |
1524
+ | ----------- | ------------------------------------------ |
1525
+ | \`"content"\` | Render from \`content/\` (recommended) |
1526
+ | \`"docs"\` | Render from \`docs/\` (common in code repos) |
1527
+ | \`"."\` | Render from repo root (use with care) |
1528
+
1529
+ ### Why This Matters
1530
+
1531
+ With \`docroot: "content"\`:
1532
+
1533
+ - Your \`README.md\` stays on GitHub, not in the docs
1534
+ - Your \`package.json\` isn't exposed
1535
+ - You can have code, tests, and docs in the same repo
1536
+
1537
+ With \`docroot: "."\`:
1538
+
1539
+ - Everything in the repo root becomes documentation
1540
+ - Useful for pure documentation repos
1541
+ - You'll want to configure \`sections\` explicitly
1542
+
1543
+ ## Customizing the Template
1544
+
1545
+ ### The Machinery
1546
+
1547
+ If you want to modify how kitfly renders:
1548
+
1549
+ - **HTML template:** \`src/site/template.html\`
1550
+ - **Styles:** \`src/site/styles.css\`
1551
+ - **Dev server:** \`scripts/dev.ts\`
1552
+ - **Build script:** \`scripts/build.ts\`
1553
+
1554
+ These are ~500 lines total. Read them, understand them, modify if needed.
1555
+
1556
+ ### Brand Assets
1557
+
1558
+ Replace files in \`assets/brand/\`:
1559
+
1560
+ - \`kitfly-logo.svg\` - Vector logo (ensure tight viewBox)
1561
+ - \`kitfly-logo-512.png\` - Used in README
1562
+ - \`kitfly-logo-128.png\` - Sidebar header fallback
1563
+ - \`kitfly-favicon-32.png\` - Browser favicon
1564
+
1565
+ These are copied to \`dist/assets/\` during build.
1566
+
1567
+ ## For Different Use Cases
1568
+
1569
+ ### Documentation alongside code
1570
+
1571
+ \`\`\`
1572
+ my-project/
1573
+ ├── src/ # Your code
1574
+ ├── tests/ # Your tests
1575
+ ├── docs/ # Your documentation
1576
+ │ ├── index.md
1577
+ │ └── api/
1578
+ └── site.yaml # docroot: "docs"
1579
+ \`\`\`
1580
+
1581
+ ### Pure documentation repo
1582
+
1583
+ \`\`\`
1584
+ my-docs/
1585
+ ├── index.md
1586
+ ├── guides/
1587
+ ├── reference/
1588
+ └── site.yaml # docroot: "."
1589
+ \`\`\`
1590
+
1591
+ ### Existing markdown
1592
+
1593
+ Point kitfly at any folder:
1594
+
1595
+ \`\`\`bash
1596
+ kitfly dev ./path/to/markdown
1597
+ \`\`\`
1598
+
1599
+ No need to restructure anything.`],
1600
+ ["userguide/cli", "Kitfly CLI Reference", `# Kitfly CLI Reference
1601
+
1602
+ Command-line interface for kitfly - turn your writing into a website.
1603
+
1604
+ ## Quick Reference
1605
+
1606
+ | Command | Description |
1607
+ | ---------------- | ---------------------------------------- |
1608
+ | \`kitfly dev\` | Start development server with hot reload |
1609
+ | \`kitfly build\` | Build static site to dist/ |
1610
+ | \`kitfly bundle\` | Build single-file HTML bundle |
1611
+ | \`kitfly init\` | Create new project from template |
1612
+ | \`kitfly update\` | Update standalone site code |
1613
+ | \`kitfly servers\` | List running dev servers |
1614
+ | \`kitfly stop\` | Stop dev server(s) |
1615
+ | \`kitfly version\` | Show version information |
1616
+ | \`kitfly help\` | Show help message |
1617
+
1618
+ ## Global Behavior
1619
+
1620
+ - All commands read configuration from \`site.yaml\` if present
1621
+ - Environment variables can override most options (prefixed with \`KITFLY_\`)
1622
+ - Exit codes: 0 = success, 1 = error
1623
+
1624
+ ## Command Documentation
1625
+
1626
+ - [dev](dev.md) - Development server
1627
+ - [build](build.md) - Static site generation
1628
+ - [bundle](bundle.md) - Single-file HTML output
1629
+ - [init](init.md) - Project initialization
1630
+ - [update](update.md) - Site code updates
1631
+ - [servers](servers.md) - Server management
1632
+ - [stop](stop.md) - Stop servers
1633
+ - [version](version.md) - Version information`],
1634
+ ["userguide/cli/build", "kitfly build", `# kitfly build
1635
+
1636
+ Build static site to output directory.
1637
+
1638
+ ## Usage
1639
+
1640
+ \`\`\`bash
1641
+ kitfly build [folder] [options]
1642
+ \`\`\`
1643
+
1644
+ ## Description
1645
+
1646
+ Generates a complete static HTML site from your markdown files. The output can be deployed to any static hosting service (GitHub Pages, Netlify, S3, etc.).
1647
+
1648
+ ## Arguments
1649
+
1650
+ | Argument | Description |
1651
+ | -------- | -------------------------------------------------------------------------------- |
1652
+ | \`folder\` | Content folder to build (default: current directory or \`docroot\` from site.yaml) |
1653
+
1654
+ ## Options
1655
+
1656
+ | Option | Environment Variable | Default | Description |
1657
+ | ------------- | -------------------- | ------- | -------------------------------- |
1658
+ | \`--out <dir>\` | \`KITFLY_BUILD_OUT\` | dist | Output directory |
1659
+ | \`--no-raw\` | - | false | Don't include raw markdown files |
1660
+
1661
+ ## Examples
1662
+
1663
+ ### Basic usage
1664
+
1665
+ \`\`\`bash
1666
+ # Build current project
1667
+ kitfly build
1668
+
1669
+ # Build specific folder
1670
+ kitfly build ./docs
1671
+
1672
+ # Custom output directory
1673
+ kitfly build --out ./public
1674
+ \`\`\`
1675
+
1676
+ ### Without raw markdown
1677
+
1678
+ \`\`\`bash
1679
+ # HTML only, no .md files in output
1680
+ kitfly build --no-raw
1681
+ \`\`\`
1682
+
1683
+ ## Output Structure
1684
+
1685
+ \`\`\`
1686
+ dist/
1687
+ ├── index.html
1688
+ ├── guide/
1689
+ │ ├── getting-started.html
1690
+ │ └── getting-started.md # (if --no-raw not specified)
1691
+ ├── reference/
1692
+ │ └── ...
1693
+ └── assets/
1694
+ └── ...
1695
+ \`\`\`
1696
+
1697
+ ## Raw Markdown Files
1698
+
1699
+ By default, kitfly includes the original \`.md\` files alongside the generated HTML. This allows:
1700
+
1701
+ - Downloading source for offline editing
1702
+ - Transparency about content source
1703
+ - Easy content migration
1704
+
1705
+ Use \`--no-raw\` to exclude these files if not needed.
1706
+
1707
+ ## Plugin validation errors (triple-colon fences)
1708
+
1709
+ Some plugins add special block syntax (for example, \`slides-visuals\` uses \`:::\` fences).
1710
+
1711
+ When a plugin is enabled, kitfly may validate your content during the build. If validation fails, \`kitfly build\` will exit with a clear error message so you can fix the content and re-run the build.
1712
+
1713
+ See the exact contract (with examples): \`../../../content/reference/plugins.html#triple-colon-fence-contract-slides-visuals\`.
1714
+
1715
+ ## See Also
1716
+
1717
+ - [kitfly dev](dev.md) - Development server
1718
+ - [kitfly bundle](bundle.md) - Single-file output`],
1719
+ ["userguide/cli/bundle", "kitfly bundle", `# kitfly bundle
1720
+
1721
+ Build single-file HTML bundle.
1722
+
1723
+ ## Usage
1724
+
1725
+ \`\`\`bash
1726
+ kitfly bundle [folder] [options]
1727
+ \`\`\`
1728
+
1729
+ ## Description
1730
+
1731
+ Creates a single, self-contained HTML file with all content, styles, and navigation embedded. Perfect for sharing via email, Slack, or file sharing services.
1732
+
1733
+ ## Arguments
1734
+
1735
+ | Argument | Description |
1736
+ | -------- | --------------------------------------------------------------------------------- |
1737
+ | \`folder\` | Content folder to bundle (default: current directory or \`docroot\` from site.yaml) |
1738
+
1739
+ ## Options
1740
+
1741
+ | Option | Environment Variable | Default | Description |
1742
+ | --------------- | -------------------- | ----------- | ------------------------------ |
1743
+ | \`--out <dir>\` | \`KITFLY_BUILD_OUT\` | dist | Output directory |
1744
+ | \`--name <file>\` | - | bundle.html | Output filename |
1745
+ | \`--raw\` | \`KITFLY_BUILD_RAW\` | true | Include raw markdown in bundle |
1746
+ | \`--no-raw\` | - | - | Don't include raw markdown |
1747
+
1748
+ ## Examples
1749
+
1750
+ ### Basic usage
1751
+
1752
+ \`\`\`bash
1753
+ # Create bundle.html in dist/
1754
+ kitfly bundle
1755
+
1756
+ # Custom filename
1757
+ kitfly bundle --name my-docs.html
1758
+
1759
+ # Custom output location
1760
+ kitfly bundle --out ./release --name handbook.html
1761
+ \`\`\`
1762
+
1763
+ ## Output
1764
+
1765
+ A single HTML file containing:
1766
+
1767
+ - All page content with images inlined as base64 data URIs
1768
+ - Embedded CSS styles
1769
+ - Syntax highlighting (Prism.js, inlined)
1770
+ - Diagram rendering (Mermaid, inlined)
1771
+ - Navigation and table of contents
1772
+ - Dark mode support
1773
+ - Brand logo and favicon (inlined)
1774
+ - No external dependencies (works fully offline)
1775
+
1776
+ ## Use Cases
1777
+
1778
+ - **Email attachment**: Share documentation without hosting
1779
+ - **Offline reading**: Works without internet connection
1780
+ - **Review cycles**: Send to stakeholders for feedback
1781
+ - **Archival**: Single-file snapshot of documentation
1782
+ - **Client handoff**: Portable single-file deliverable with all images embedded
1783
+
1784
+ ## File Size
1785
+
1786
+ Bundle size depends on content volume and images. Typical documentation sites produce bundles of 100KB-1MB. Sites with many images will be larger due to base64 encoding (~33% overhead per image).
1787
+
1788
+ ## Plugin validation errors (triple-colon fences)
1789
+
1790
+ Some plugins add special block syntax (for example, \`slides-visuals\` uses \`:::\` fences).
1791
+
1792
+ When a plugin is enabled, kitfly may validate your content before bundling. If validation fails, \`kitfly bundle\` will exit with a clear error message so you can fix the content and re-run the bundle.
1793
+
1794
+ See the exact contract (with examples): \`../../../content/reference/plugins.html#triple-colon-fence-contract-slides-visuals\`.
1795
+
1796
+ ## See Also
1797
+
1798
+ - [kitfly build](build.md) - Multi-file static build
1799
+ - [kitfly dev](dev.md) - Development server`],
1800
+ ["userguide/cli/dev", "kitfly dev", `# kitfly dev
1801
+
1802
+ Start development server with hot reload.
1803
+
1804
+ ## Usage
1805
+
1806
+ \`\`\`bash
1807
+ kitfly dev [folder] [options]
1808
+ \`\`\`
1809
+
1810
+ ## Description
1811
+
1812
+ Launches a local development server that renders your markdown files and automatically reloads when content changes. This is the primary command for authoring documentation.
1813
+
1814
+ ## Arguments
1815
+
1816
+ | Argument | Description |
1817
+ | -------- | -------------------------------------------------------------------------------- |
1818
+ | \`folder\` | Content folder to serve (default: current directory or \`docroot\` from site.yaml) |
1819
+
1820
+ ## Options
1821
+
1822
+ | Option | Environment Variable | Default | Description |
1823
+ | ---------------- | -------------------- | --------- | ------------------------------------- |
1824
+ | \`--port <n>\` | \`KITFLY_DEV_PORT\` | 3333 | Server port |
1825
+ | \`--host <h>\` | \`KITFLY_DEV_HOST\` | localhost | Server host |
1826
+ | \`--daemon\`, \`-d\` | - | false | Run in background, return immediately |
1827
+ | \`--json\` | - | false | Output JSON (implies --daemon) |
1828
+ | \`--no-open\` | - | false | Don't open browser automatically |
1829
+
1830
+ ## Examples
1831
+
1832
+ ### Basic usage
1833
+
1834
+ \`\`\`bash
1835
+ # Serve current directory
1836
+ kitfly dev
1837
+
1838
+ # Serve specific folder
1839
+ kitfly dev ./docs
1840
+
1841
+ # Custom port
1842
+ kitfly dev --port 8080
1843
+ \`\`\`
1844
+
1845
+ ### Background mode
1846
+
1847
+ \`\`\`bash
1848
+ # Run as daemon
1849
+ kitfly dev --daemon
1850
+
1851
+ # Get JSON output for scripting
1852
+ kitfly dev --json
1853
+ \`\`\`
1854
+
1855
+ ### Output (JSON mode)
1856
+
1857
+ \`\`\`json
1858
+ {
1859
+ "pid": 12345,
1860
+ "port": 3333,
1861
+ "url": "http://localhost:3333"
1862
+ }
1863
+ \`\`\`
1864
+
1865
+ ## Port Conflict Detection
1866
+
1867
+ If the specified port is already in use, kitfly will report an error rather than silently choosing another port. Use \`kitfly servers\` to see what's running.
1868
+
1869
+ ## Hot Reload
1870
+
1871
+ The dev server watches for changes to:
1872
+
1873
+ - Markdown files (\`.md\`)
1874
+ - Configuration (\`site.yaml\`, \`theme.yaml\`)
1875
+ - Template files
1876
+
1877
+ Changes are reflected immediately without manual refresh.
1878
+
1879
+ ## Plugin validation errors (triple-colon fences)
1880
+
1881
+ Some plugins add special block syntax (for example, \`slides-visuals\` uses \`:::\` fences).
1882
+
1883
+ When a plugin is enabled, kitfly may validate your content before rendering. If validation fails, \`kitfly dev\` will exit with a clear error message so you can fix the content and restart.
1884
+
1885
+ See the exact contract (with examples): \`../../../content/reference/plugins.html#triple-colon-fence-contract-slides-visuals\`.
1886
+
1887
+ ## See Also
1888
+
1889
+ - [kitfly build](build.md) - Build static site
1890
+ - [kitfly servers](servers.md) - List running servers
1891
+ - [kitfly stop](stop.md) - Stop servers`],
1892
+ ["userguide/cli/init", "kitfly init", `# kitfly init
1893
+
1894
+ Create new project from template.
1895
+
1896
+ ## Usage
1897
+
1898
+ \`\`\`bash
1899
+ kitfly init [name] [options]
1900
+ \`\`\`
1901
+
1902
+ ## Description
1903
+
1904
+ Initializes a new kitfly project with all necessary files and folder structure. Creates a standalone site that you own and can customize.
1905
+
1906
+ ## Arguments
1907
+
1908
+ | Argument | Description |
1909
+ | -------- | --------------------------------------------------- |
1910
+ | \`name\` | Project directory name (default: current directory) |
1911
+
1912
+ ## Options
1913
+
1914
+ | Option | Description |
1915
+ | ------------------- | -------------------------------------------------------------------- |
1916
+ | \`--template <name>\` | Template to use: \`minimal\`, \`handbook\`, \`runbook\` (default: minimal) |
1917
+ | \`--standalone\` | Create self-contained site with rendering code (default: true) |
1918
+ | \`--brand <name>\` | Set brand name |
1919
+ | \`--brand-url <url>\` | Set brand URL |
1920
+
1921
+ ## Templates
1922
+
1923
+ ### minimal
1924
+
1925
+ Basic documentation site with simple structure:
1926
+
1927
+ - Single content section
1928
+ - Clean starting point
1929
+ - Minimal example content
1930
+
1931
+ ### handbook
1932
+
1933
+ Team/company handbook template:
1934
+
1935
+ - Multiple sections (About, Policies, Guides, Resources)
1936
+ - Onboarding-focused structure
1937
+ - Sample policies and guides
1938
+
1939
+ ### runbook
1940
+
1941
+ Operations runbook template:
1942
+
1943
+ - Procedures, Troubleshooting, Reference, Incidents sections
1944
+ - Operations-focused structure
1945
+ - Incident response templates
1946
+
1947
+ ## Examples
1948
+
1949
+ ### Basic usage
1950
+
1951
+ \`\`\`bash
1952
+ # Create in new directory
1953
+ kitfly init my-docs
1954
+
1955
+ # Create in current directory
1956
+ kitfly init .
1957
+
1958
+ # Use handbook template
1959
+ kitfly init company-handbook --template handbook
1960
+ \`\`\`
1961
+
1962
+ ### With branding
1963
+
1964
+ \`\`\`bash
1965
+ kitfly init my-docs --brand "Acme Corp" --brand-url "https://acme.com"
1966
+ \`\`\`
1967
+
1968
+ ## Output Structure
1969
+
1970
+ \`\`\`
1971
+ my-docs/
1972
+ ├── content/
1973
+ │ └── index.md
1974
+ ├── scripts/
1975
+ │ ├── dev.ts
1976
+ │ ├── build.ts
1977
+ │ └── bundle.ts
1978
+ ├── src/
1979
+ │ └── ...
1980
+ ├── site.yaml
1981
+ ├── theme.yaml
1982
+ ├── package.json
1983
+ └── README.md
1984
+ \`\`\`
1985
+
1986
+ ## After Initialization
1987
+
1988
+ \`\`\`bash
1989
+ cd my-docs
1990
+ bun install
1991
+ bun run dev
1992
+ \`\`\`
1993
+
1994
+ ## Standalone Mode
1995
+
1996
+ By default, \`kitfly init\` creates a standalone site with its own copy of:
1997
+
1998
+ - Rendering scripts (dev, build, bundle)
1999
+ - Engine and theme code
2000
+ - Configuration schemas
2001
+
2002
+ This means your site is independent - no kitfly CLI required after setup.
2003
+
2004
+ ## See Also
2005
+
2006
+ - [kitfly update](update.md) - Update site code
2007
+ - [kitfly dev](dev.md) - Start development`],
2008
+ ["userguide/cli/servers", "kitfly servers", `# kitfly servers
2009
+
2010
+ List running dev servers.
2011
+
2012
+ ## Usage
2013
+
2014
+ \`\`\`bash
2015
+ kitfly servers [options]
2016
+ \`\`\`
2017
+
2018
+ ## Description
2019
+
2020
+ Displays all kitfly dev servers currently running on this machine. Useful for managing multiple documentation projects or finding orphaned servers.
2021
+
2022
+ ## Options
2023
+
2024
+ | Option | Description |
2025
+ | -------- | -------------- |
2026
+ | \`--json\` | Output as JSON |
2027
+
2028
+ ## Examples
2029
+
2030
+ ### Basic usage
2031
+
2032
+ \`\`\`bash
2033
+ $ kitfly servers
2034
+ PORT PID PROJECT
2035
+ 3333 12345 /Users/me/docs/handbook
2036
+ 3340 12346 /Users/me/docs/runbook
2037
+ \`\`\`
2038
+
2039
+ ### JSON output
2040
+
2041
+ \`\`\`bash
2042
+ $ kitfly servers --json
2043
+ [
2044
+ {"port": 3333, "pid": 12345, "project": "/Users/me/docs/handbook"},
2045
+ {"port": 3340, "pid": 12346, "project": "/Users/me/docs/runbook"}
2046
+ ]
2047
+ \`\`\`
2048
+
2049
+ ### No servers running
2050
+
2051
+ \`\`\`bash
2052
+ $ kitfly servers
2053
+ No kitfly servers running
2054
+ \`\`\`
2055
+
2056
+ ## Output Fields
2057
+
2058
+ | Field | Description |
2059
+ | --------- | ---------------------- |
2060
+ | \`PORT\` | Server port number |
2061
+ | \`PID\` | Process ID |
2062
+ | \`PROJECT\` | Project directory path |
2063
+
2064
+ ## Server Registry
2065
+
2066
+ Kitfly maintains a registry of running servers at:
2067
+
2068
+ - macOS/Linux: \`~/.kitfly/servers.json\`
2069
+ - Windows: \`%USERPROFILE%\\.kitfly\\servers.json\`
2070
+
2071
+ The registry is automatically cleaned up when servers stop normally.
2072
+
2073
+ ## See Also
2074
+
2075
+ - [kitfly dev](dev.md) - Start a server
2076
+ - [kitfly stop](stop.md) - Stop servers`],
2077
+ ["userguide/cli/stop", "kitfly stop", `# kitfly stop
2078
+
2079
+ Stop dev server(s).
2080
+
2081
+ ## Usage
2082
+
2083
+ \`\`\`bash
2084
+ kitfly stop <port|all> [options]
2085
+ \`\`\`
2086
+
2087
+ ## Description
2088
+
2089
+ Stops one or more running kitfly dev servers. Can target a specific port or stop all servers at once.
2090
+
2091
+ ## Arguments
2092
+
2093
+ | Argument | Description |
2094
+ | -------- | ------------------------------- |
2095
+ | \`port\` | Port number of server to stop |
2096
+ | \`all\` | Stop all running kitfly servers |
2097
+
2098
+ ## Options
2099
+
2100
+ | Option | Description |
2101
+ | --------- | ---------------------------------------- |
2102
+ | \`--force\` | Skip graceful shutdown, kill immediately |
2103
+
2104
+ ## Examples
2105
+
2106
+ ### Stop specific server
2107
+
2108
+ \`\`\`bash
2109
+ # Stop server on port 3333
2110
+ kitfly stop 3333
2111
+ \`\`\`
2112
+
2113
+ ### Stop all servers
2114
+
2115
+ \`\`\`bash
2116
+ # Graceful shutdown of all servers
2117
+ kitfly stop all
2118
+ \`\`\`
2119
+
2120
+ ### Force stop
2121
+
2122
+ \`\`\`bash
2123
+ # Immediate termination (use if graceful fails)
2124
+ kitfly stop 3333 --force
2125
+ kitfly stop all --force
2126
+ \`\`\`
2127
+
2128
+ ## Graceful vs Force Shutdown
2129
+
2130
+ **Graceful** (default):
2131
+
2132
+ - Sends SIGTERM signal
2133
+ - Allows server to clean up
2134
+ - Waits briefly for process to exit
2135
+
2136
+ **Force** (\`--force\`):
2137
+
2138
+ - Sends SIGKILL signal
2139
+ - Immediate termination
2140
+ - Use when graceful shutdown hangs
2141
+
2142
+ ## Exit Codes
2143
+
2144
+ | Code | Meaning |
2145
+ | ---- | ------------------------------------------------- |
2146
+ | 0 | Server(s) stopped successfully |
2147
+ | 1 | Error (server not found, permission denied, etc.) |
2148
+
2149
+ ## See Also
2150
+
2151
+ - [kitfly servers](servers.md) - List running servers
2152
+ - [kitfly dev](dev.md) - Start a server`],
2153
+ ["userguide/cli/update", "kitfly update", `# kitfly update
2154
+
2155
+ Update standalone site code.
2156
+
2157
+ ## Usage
2158
+
2159
+ \`\`\`bash
2160
+ kitfly update [version] [options]
2161
+ \`\`\`
2162
+
2163
+ ## Description
2164
+
2165
+ Updates the kitfly rendering code in a standalone site to a newer version. Preserves your content and configuration while upgrading the engine.
2166
+
2167
+ > **Note**: This command is planned for v0.2.0 and may not be fully implemented yet.
2168
+
2169
+ ## Arguments
2170
+
2171
+ | Argument | Description |
2172
+ | --------- | -------------------------------- |
2173
+ | \`version\` | Target version (default: latest) |
2174
+
2175
+ ## Options
2176
+
2177
+ | Option | Description |
2178
+ | ----------- | ------------------------------------------- |
2179
+ | \`--dry-run\` | Preview changes without applying |
2180
+ | \`--force\` | Update even if local modifications detected |
2181
+
2182
+ ## Examples
2183
+
2184
+ ### Basic usage
2185
+
2186
+ \`\`\`bash
2187
+ # Update to latest version
2188
+ kitfly update
2189
+
2190
+ # Update to specific version
2191
+ kitfly update 0.2.0
2192
+
2193
+ # Preview changes first
2194
+ kitfly update --dry-run
2195
+ \`\`\`
2196
+
2197
+ ## What Gets Updated
2198
+
2199
+ - \`scripts/dev.ts\`, \`scripts/build.ts\`, \`scripts/bundle.ts\`
2200
+ - \`src/engine.ts\`, \`src/theme.ts\`
2201
+ - \`src/site/template.html\`, \`src/site/styles.css\`
2202
+ - Schema files in \`schemas/\`
2203
+
2204
+ ## What Is Preserved
2205
+
2206
+ - \`content/\` - Your documentation
2207
+ - \`site.yaml\` - Site configuration
2208
+ - \`theme.yaml\` - Theme customization
2209
+ - Custom modifications (with warning)
2210
+
2211
+ ## Modification Detection
2212
+
2213
+ Kitfly tracks file checksums to detect local modifications. If you've customized engine files:
2214
+
2215
+ 1. Update will warn about modifications
2216
+ 2. Use \`--force\` to overwrite
2217
+ 3. Or manually merge changes
2218
+
2219
+ ## Version Compatibility
2220
+
2221
+ Updates follow semantic versioning:
2222
+
2223
+ - **Patch** (0.1.x): Safe, backward-compatible fixes
2224
+ - **Minor** (0.x.0): New features, may need config updates
2225
+ - **Major** (x.0.0): Breaking changes, migration may be required
2226
+
2227
+ ## See Also
2228
+
2229
+ - [kitfly init](init.md) - Create new project
2230
+ - [kitfly version](version.md) - Check current version`],
2231
+ ["userguide/cli/version", "kitfly version", `# kitfly version
2232
+
2233
+ Show version information.
2234
+
2235
+ ## Usage
2236
+
2237
+ \`\`\`bash
2238
+ kitfly version [extended]
2239
+ kitfly version --extended
2240
+ kitfly --version
2241
+ kitfly -v
2242
+ \`\`\`
2243
+
2244
+ ## Description
2245
+
2246
+ Displays the current kitfly version. Use \`extended\` for detailed provenance information useful for debugging and support.
2247
+
2248
+ ## Options
2249
+
2250
+ | Option | Description |
2251
+ | ------------ | ------------------------------------------------ |
2252
+ | \`extended\` | Show extended version with git and platform info |
2253
+ | \`--extended\` | Same as \`extended\` subcommand |
2254
+
2255
+ ## Output
2256
+
2257
+ ### Basic Version
2258
+
2259
+ \`\`\`bash
2260
+ $ kitfly version
2261
+ 0.1.0
2262
+ \`\`\`
2263
+
2264
+ ### Extended Version
2265
+
2266
+ \`\`\`bash
2267
+ $ kitfly version extended
2268
+ kitfly 0.1.0
2269
+ Git commit: b95c6a8
2270
+ Git branch: main
2271
+ Git status: clean
2272
+ Bun: 1.3.7
2273
+ Platform: darwin/arm64
2274
+ \`\`\`
2275
+
2276
+ ## Extended Output Fields
2277
+
2278
+ | Field | Description |
2279
+ | ------------ | --------------------------------------------------- |
2280
+ | \`kitfly\` | Current version from VERSION file |
2281
+ | \`Git commit\` | Short SHA of current commit |
2282
+ | \`Git branch\` | Current git branch name |
2283
+ | \`Git status\` | "clean" or "dirty (uncommitted changes)" |
2284
+ | \`Bun\` | Bun runtime version |
2285
+ | \`Platform\` | OS and architecture (e.g., darwin/arm64, linux/x64) |
2286
+
2287
+ ## Use Cases
2288
+
2289
+ - **Bug reports**: Include \`kitfly version extended\` output
2290
+ - **Debugging**: Verify which version and commit is running
2291
+ - **Support**: Confirm runtime environment
2292
+
2293
+ ## See Also
2294
+
2295
+ - [kitfly help](README.md)`],
2296
+ ["userguide/sharing", "Sharing Your Docs", `# Sharing Your Docs
2297
+
2298
+ Kitfly has two export modes that serve different sharing needs.
2299
+
2300
+ ## Send It — Single HTML File
2301
+
2302
+ Use \`kitfly bundle\` when you need to share docs without hosting.
2303
+
2304
+ \`\`\`bash
2305
+ kitfly bundle --name my-docs.html
2306
+ \`\`\`
2307
+
2308
+ This produces one self-contained HTML file with everything inlined: content, styles, images (as base64), syntax highlighting, and diagrams. No server needed — just open the file.
2309
+
2310
+ ### When to use bundle
2311
+
2312
+ | Scenario | Example |
2313
+ | ------------------- | --------------------------------------- |
2314
+ | Email attachment | Send docs to a client or reviewer |
2315
+ | Slack/Teams upload | Drop into a channel for quick reference |
2316
+ | Shared drive | Put on Google Drive, Dropbox, OneDrive |
2317
+ | USB/offline handoff | Works without internet |
2318
+ | Review cycle | Stakeholders open in any browser |
2319
+ | Archival | Point-in-time snapshot of your docs |
2320
+
2321
+ ### Bundle tips
2322
+
2323
+ - **File size**: Typical docs produce 100KB–1MB bundles. Image-heavy sites will be larger (base64 adds ~33% overhead per image).
2324
+ - **Custom name**: Use \`--name\` to give the file a meaningful name for recipients (\`--name q1-review.html\`).
2325
+ - **Strip raw markdown**: Use \`--no-raw\` if you don't want source \`.md\` accessible inside the bundle.
2326
+
2327
+ ## Host It — Static Site
2328
+
2329
+ Use \`kitfly build\` when you want to deploy to a web server.
2330
+
2331
+ \`\`\`bash
2332
+ kitfly build --out ./dist
2333
+ \`\`\`
2334
+
2335
+ This produces a \`dist/\` directory with standard HTML, CSS, and assets. Deploy it anywhere that serves static files.
2336
+
2337
+ ### Deployment targets
2338
+
2339
+ | Platform | How |
2340
+ | ------------------ | --------------------------------------------------------------------------- |
2341
+ | **GitHub Pages** | Push \`dist/\` to \`gh-pages\` branch or configure Pages to serve from a folder |
2342
+ | **Netlify** | Set build command to \`kitfly build\`, publish directory to \`dist\` |
2343
+ | **Vercel** | Same pattern — build command + output directory |
2344
+ | **AWS S3** | Sync \`dist/\` to an S3 bucket with static hosting enabled |
2345
+ | **Any web server** | Copy \`dist/\` contents to your server's document root |
2346
+ | **Local preview** | \`open dist/index.html\` in your browser |
2347
+
2348
+ ### Build tips
2349
+
2350
+ - **Custom output**: \`--out ./public\` if your host expects a different directory name.
2351
+ - **Raw markdown included**: By default, \`.md\` source files are copied alongside HTML for transparency. Use \`--no-raw\` to exclude them.
2352
+ - **AI accessibility**: Build output includes \`content-index.json\`, \`llms.txt\`, and a \`_raw/\` directory so AI agents can read your docs. Use \`--no-raw\` to opt out.
2353
+
2354
+ ## Choosing Between Bundle and Build
2355
+
2356
+ | Need | Use |
2357
+ | ----------------------------- | -------- |
2358
+ | Share with one person | \`bundle\` |
2359
+ | Share with a team (no server) | \`bundle\` |
2360
+ | Publish to the web | \`build\` |
2361
+ | Need search engine indexing | \`build\` |
2362
+ | Must work offline (no setup) | \`bundle\` |
2363
+ | CI/CD pipeline | \`build\` |
2364
+ | Email attachment | \`bundle\` |
2365
+ | GitHub Pages / Netlify | \`build\` |
2366
+
2367
+ You can use both — \`bundle\` for quick reviews, \`build\` for the published site.
2368
+
2369
+ ## Development Preview
2370
+
2371
+ During writing, use the dev server instead of building:
2372
+
2373
+ \`\`\`bash
2374
+ kitfly dev
2375
+ \`\`\`
2376
+
2377
+ This starts a local server at \`http://localhost:3333\` with hot reload. Edit any \`.md\` file and see changes instantly. When you're ready to share, switch to \`bundle\` or \`build\`.
2378
+
2379
+ ## See Also
2380
+
2381
+ - [kitfly build](cli/build.md) — Build command reference
2382
+ - [kitfly bundle](cli/bundle.md) — Bundle command reference
2383
+ - [kitfly dev](cli/dev.md) — Development server`],
2384
+ ];