Home / Function/ getRefMarkdownInternal() — supabase Function Reference

getRefMarkdownInternal() — supabase Function Reference

Architecture documentation for the getRefMarkdownInternal() function in Reference.mdx.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/docs/features/docs/Reference.mdx.tsx lines 13–28

async function getRefMarkdownInternal(relPath: string) {
  const fullPath = join(REF_DOCS_DIRECTORY, relPath + '.mdx')

  try {
    if (!fullPath.startsWith(REF_DOCS_DIRECTORY)) {
      throw Error(`Accessing forbidden path outside of REF_DOCS_DIRECTORY: ${fullPath}`)
    }

    const mdx = await readFile(fullPath, 'utf-8')
    const { content } = matter(mdx)
    return content
  } catch (err) {
    console.error(`Error fetching reference markdown from file: ${fullPath}:\n\n${err}`)
    return ''
  }
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free