Skip to main content
Docs

10. Generation-Pipeline

Wenn der User auf "Generate" klickt, läuft folgende Sequenz:

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, gefährliche Tags raus
  2. sectionize — Markdown wird in logische Sektionen aufgeteilt (----Separator oder LLM)
  3. detectSectionTypes — pro Sektion: ist das ein Hero, FAQ, Pricing, …?
  4. extractContent — strukturiertes Daten-Object pro Sektion (z.B. Hero → { title, subtitle, cta, image })
  5. validate — Schema-Check pro Komponente, messages[] mit Severity-Level

10.2 Docs-Branch#

  1. Frontmatter extrahieren (title, description, group, order)
  2. TOC aus Headings generieren (h2/h3/h4)
  3. Sidebar-Groups aus allen Pages des Projekts (group-Field)
  4. Body bleibt Raw-Markdown (wird im Render durch react-markdown gejagt)
  5. DocsPageInput Object → renderDocsPage()

10.3 LLM-Cache#

Jeder Mapping-Call wird mit mdHash = sha256(mdContent) gekeyed. Beim zweiten Generate mit demselben Inhalt → DB-Lookup, kein Call. Spart Tokens und Latenz.