const fs = require('fs'); const path = require('path'); const { marked } = require('marked'); // ─── Config ──────────────────────────────────────────────── const LOG_DIR = path.join(__dirname, 'llm_log'); const OUTPUT_FILE = path.join(__dirname, 'index.html'); // ─── Marked Config ───────────────────────────────────────── const headingIds = new Map(); const renderer = new marked.Renderer(); renderer.code = function (code, lang) { const validLang = lang || 'text'; const highlighted = highlightCode(code, validLang); const id = 'highlight-' + Math.random().toString(36).slice(2, 8); return `
${highlighted}`;
};
renderer.codespan = function (code) {
return `${code}`;
};
renderer.tablerow = function (content) {
return `${path.basename(p.filePath)}