MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / detectNamespaces

Function detectNamespaces

docs/scripts/rewrite-doc-links.mjs:116–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116async function detectNamespaces() {
117 const namespaces = [];
118 const currentDocs = path.join(docsDir, 'docs');
119 try {
120 const stat = await fs.stat(currentDocs);
121 if (stat.isDirectory()) namespaces.push(currentDocs);
122 } catch {}
123
124 const versionedRoot = path.join(docsDir, 'versioned_docs');
125 try {
126 const entries = await fs.readdir(versionedRoot, { withFileTypes: true });
127 for (const e of entries) {
128 if (e.isDirectory() && e.name.startsWith('version-')) {
129 namespaces.push(path.join(versionedRoot, e.name));
130 }
131 }
132 } catch {}
133
134 return namespaces;
135}
136
137function markdownLinkRewriter(content, rewriter) {
138 const pattern = /\[[^\]]*?\]\((\/[^)\s]*?)\)/g;

Callers 1

mainFunction · 0.85

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…