(hubPath: string)
| 55 | } |
| 56 | |
| 57 | export async function parseHubFile(hubPath: string): Promise<HubInfo> { |
| 58 | const content = await readFile(hubPath, "utf-8"); |
| 59 | const lines = content.split("\n"); |
| 60 | |
| 61 | let title = basename(hubPath, extname(hubPath)); |
| 62 | const headingMatch = content.match(/^#\s+(.+)$/m); |
| 63 | if (headingMatch) title = headingMatch[1].trim(); |
| 64 | |
| 65 | return { |
| 66 | hubPath, |
| 67 | title, |
| 68 | links: parseWikiLinks(content), |
| 69 | crossLinks: parseCrossLinks(content, hubPath), |
| 70 | raw: content, |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | export async function discoverHubs(rootDir: string): Promise<string[]> { |
| 75 | const hubs: string[] = []; |
no test coverage detected