MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / fetchBriefForLibrary

Function fetchBriefForLibrary

Support/SingleFileLibs/javascript/app.js:220–233  ·  view source on GitHub ↗
(libraryName, ref)

Source from the content-addressed store, hash-verified

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

Callers 1

runNextFunction · 0.85

Calls 5

extractBriefFunction · 0.85
fetchTextFunction · 0.85
rawUrlFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected