* Render a one-line summary from a multi-paragraph description: take the * first sentence (up to '.', '!', or '?') and trim. Keeps llms.txt scannable.
(text: string)
| 109 | * first sentence (up to '.', '!', or '?') and trim. Keeps llms.txt scannable. |
| 110 | */ |
| 111 | function oneLine(text: string): string { |
| 112 | const first = text.split(/(?<=[.!?])\s/)[0] ?? text; |
| 113 | return first.replace(/\s+/g, ' ').trim(); |
| 114 | } |
| 115 | |
| 116 | interface GenerateOptions { |
| 117 | /** Override repo root (for tests). */ |