Conversation
Co-authored-by: chris <chris@knock.app>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| table += `| \`${attr.name}\` | \`${attr.type || "any"}\` | ${ | ||
| attr.description | ||
| } | ${attr.required ? "Yes" : "No"} |\n`; | ||
| } |
There was a problem hiding this comment.
Pipe characters in descriptions break markdown tables
Medium Severity
The convertAttributesToMarkdown function generates markdown table rows by directly interpolating attr.description into table cells without escaping pipe characters (|). Existing typedoc files contain descriptions with pipe characters (e.g., "One of unseen|unread|all..." in notification-icon-button.mdx). These unescaped pipes will be interpreted as column delimiters, corrupting the markdown table structure and producing malformed output for LLMs.
|
|
||
| // Extract description | ||
| const descMatch = attrString.match(/description="([^"]+)"/); | ||
| const description = descMatch ? descMatch[1] : ""; |
There was a problem hiding this comment.
JSX template literal descriptions silently dropped
Medium Severity
The regex /description="([^"]+)"/ only matches double-quoted string values. However, some typedoc files use JSX template literal syntax like description={\...`}(e.g., inms-teams-auth-button.mdx`). These descriptions won't match the regex and will default to an empty string, silently dropping the actual description content from the generated markdown table.
Description
This PR resolves an issue where the "Copy for LLM" feature for documentation pages using
<Typedoc />components would only copy the component stub, not the actual documentation content. This resulted in incomplete and unhelpful output for LLMs and users.The changes modify the
generateLlmsTxt.tsscript to:<Typedoc file="..." />components and merge the actual content from the corresponding/typedocs/MDX files into the generated markdown.<Attributes>and<Attribute>MDX components into standard Markdown tables, improving readability and utility for LLMs.This ensures that the "Copy for LLM" feature provides comprehensive and well-formatted documentation for all typed component pages.
Todos
Tasks
Screenshots
Linear Issue: KNO-10467