| 218 | |
| 219 | // Brief extraction |
| 220 | async function fetchBriefForLibrary(libraryName, ref) { |
| 221 | const path = `Documentation/Libraries/${libraryName}.md`; |
| 222 | const key = `${ref}:${path}`; |
| 223 | if (state.fileContentCache.has(key)) { |
| 224 | return extractBrief(state.fileContentCache.get(key)); |
| 225 | } |
| 226 | try { |
| 227 | const text = await fetchText(rawUrl(ref, path)); |
| 228 | state.fileContentCache.set(key, text); |
| 229 | return extractBrief(text); |
| 230 | } catch { |
| 231 | return ''; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | function extractBrief(markdown) { |
| 236 | // Look for line starting with @brief and return the rest of the line |