fix: doc rendering — markdown prose styling, code blocks with copy button, proper step parsing

- Add @tailwindcss/typography plugin for prose styling
- Create CodeBlock component with copy button and language labels
- Create Md wrapper component using ReactMarkdown with custom renderers
- Replace all plain text renders with Md for proper markdown formatting
- Fix parseSteps() in pipeline to group numbered steps with code blocks
- Add First Task subtitle explaining its purpose
- Add conditional file.purpose render in module key files
This commit is contained in:
Vectry
2026-02-09 18:18:24 +00:00
parent 029cd82f1a
commit cbe52f32b3
6 changed files with 182 additions and 30 deletions

View File

@@ -23,6 +23,29 @@ function parseList(text: string): string[] {
.filter(Boolean);
}
function parseSteps(text: string): string[] {
const lines = text.split("\n");
const steps: string[] = [];
let current = "";
for (const line of lines) {
if (/^\d+\.\s/.test(line)) {
if (current.trim()) {
steps.push(current.trim());
}
current = line.replace(/^\d+\.\s*/, "");
} else {
current += "\n" + line;
}
}
if (current.trim()) {
steps.push(current.trim());
}
return steps.filter(Boolean);
}
export async function generateDocumentation(
codeStructure: CodeStructure,
provider: LLMProvider,
@@ -112,7 +135,7 @@ export async function generateDocumentation(
const gsResponse = await provider.chat(gsMessages);
const prerequisites = parseList(parseSection(gsResponse, "Prerequisites"));
const setupSteps = parseList(parseSection(gsResponse, "Setup Steps"));
const setupSteps = parseSteps(parseSection(gsResponse, "Setup Steps"));
const firstTask = parseSection(gsResponse, "Your First Task");
onProgress?.("complete", 100);