This repository contains example Grasshopper models and their documentation for ShapeDiver. Documentation is built with mdBook from the src/ directory.
src/**/examples.json— source of truth for example metadatasrc/**/definitions.md— chapter documentation with human-written prose and generated tablestools/docs-cli/src/utils.ts— definesSCHEMA_EXAMPLEStools/docs-cli/src/validate.ts— validation logictools/docs-cli/src/createTables.ts— markdown table generationbook.toml— mdBook configuration
Treat these as the canonical sources:
src/**/examples.json- human-written prose in
src/**/definitions.md - existing model files provided by humans
Treat generated markdown tables in src/**/definitions.md as derived output.
- Never manually edit generated markdown tables in
src/**/definitions.md. - If table content must change, update
src/**/examples.jsoninstead. - Never create, modify, or rewrite
.ghx,.gh, or.3dmfiles. - Do not rename, move, or delete large groups of examples or docs unless the user explicitly asks.
- Avoid broad structural reorganizations of chapter folders or documentation layout unless explicitly asked.
- You may add or edit explanatory prose in
src/**/definitions.md. - Preserve mdBook structure and existing chapter organization unless the user asks for restructuring.
- AI may help develop repository code, including the docs CLI and related automation.
Preferred workflow:
- Use the existing human-provided model artifact in the appropriate chapter folder.
- Add or update the matching entry in that chapter's
src/**/examples.json. - Add explanatory prose to
definitions.mdonly when needed. - Do not manually regenerate or rewrite markdown tables unless the user explicitly asks for that local workflow.
Example files follow this pattern:
{chapter number}{alphabetical identifier starting from A}-{description}.{extension}
Example:
11A-AppBuilder_Tutorial1.ghx
After changing any src/**/examples.json, run:
npm run docs:validateThis validation is required, but it does not check everything. If your change affects behavior or content not fully covered by the validation script, explicitly warn the user about the remaining unchecked risk.
npm run docs:validate
mdbook serve .Use npm run docs:validate for metadata validation and mdbook serve . for local documentation preview.