MCPcopy Create free account
hub / github.com/simstudioai/sim / generateDocumentUrl

Method generateDocumentUrl

apps/sim/lib/chunkers/docs-chunker.ts:164–174  ·  view source on GitHub ↗

index.mdx files are served at the parent directory path

(relativePath: string)

Source from the content-addressed store, hash-verified

162
163 /** index.mdx files are served at the parent directory path */
164 private generateDocumentUrl(relativePath: string): string {
165 let urlPath = relativePath.replace(/\.mdx$/, '').replace(/\\/g, '/')
166
167 if (urlPath.endsWith('/index')) {
168 urlPath = urlPath.slice(0, -6)
169 } else if (urlPath === 'index') {
170 urlPath = ''
171 }
172
173 return `${this.baseUrl}/${urlPath}`
174 }
175
176 private findRelevantHeader(headers: HeaderInfo[], position: number): HeaderInfo | null {
177 if (headers.length === 0) return null

Callers 1

chunkMdxFileMethod · 0.95

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected