Skip to main content
Docs

10. Generation Pipeline

When the user clicks on "Generate", the following sequence runs:

DBrender-engineJSDOM +mermaid SSRllm_cachetableMapper LLM(gpt-5-mini)auto-detector docs pipelineAPIEditorDBrender-engineJSDOM +mermaid SSRllm_cachetableMapper LLM(gpt-5-mini)auto-detector docs pipelineAPIEditoralt[cache hit][cache miss]alt[layout: docs][default]POST /generateSELECT mdContentchoosePipeline(layout, projectType)runDocsPipeline()extract frontmatter, TOCbuild sidebar groupsrunAutoDetectPipeline()sanitize HTMLlookup by mdHashcached mappingsectionize prompt{ sections: [...] }INSERT mappingdetect types per sectionextract content (V2 parser)validate against schemasprerenderMermaidBlocks(body, pack){ source → svg map }renderDocsPage / renderPageHTML stringUPDATE pages SET generatedJson{ html, sections, validation }
DBrender-engineJSDOM +mermaid SSRllm_cachetableMapper LLM(gpt-5-mini)auto-detector docs pipelineAPIEditorDBrender-engineJSDOM +mermaid SSRllm_cachetableMapper LLM(gpt-5-mini)auto-detector docs pipelineAPIEditoralt[cache hit][cache miss]alt[layout: docs][default]POST /generateSELECT mdContentchoosePipeline(layout, projectType)runDocsPipeline()extract frontmatter, TOCbuild sidebar groupsrunAutoDetectPipeline()sanitize HTMLlookup by mdHashcached mappingsectionize prompt{ sections: [...] }INSERT mappingdetect types per sectionextract content (V2 parser)validate against schemasprerenderMermaidBlocks(body, pack){ source → svg map }renderDocsPage / renderPageHTML stringUPDATE pages SET generatedJson{ html, sections, validation }

10.1 Auto-Detect-Branch#

  1. sanitize — HTML stripping, dangerous tags removed
  2. sectionize — Markdown is divided into logical sections (--- separator or LLM)
  3. detectSectionTypes — per section: is this a Hero, FAQ, Pricing, …?
  4. extractContent — structured data object per section (e.g. Hero → { title, subtitle, cta, image })
  5. validate — schema check per component, messages[] with severity level

10.2 Docs-Branch#

  1. Extract frontmatter (title, description, group, order)
  2. Generate TOC from headings (h2/h3/h4)
  3. Sidebar groups from all pages of the project (group field)
  4. Body remains raw Markdown (passed through react-markdown in the renderer)
  5. DocsPageInput Object → renderDocsPage()

10.3 LLM-Cache#

Every mapping call is keyed with mdHash = sha256(mdContent). On the second generate with the same content → DB lookup, no call. Saves tokens and latency.#