Home / Function/ getDocFiles() — supabase Function Reference

getDocFiles() — supabase Function Reference

Architecture documentation for the getDocFiles() function in build-llms-txt.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  13bb9435_ca50_3c2a_2cdd_91ac8adefc34["getDocFiles()"]
  92c31549_4d2a_ee9b_56cd_3f0d09f7b149["getMdxFiles()"]
  13bb9435_ca50_3c2a_2cdd_91ac8adefc34 -->|calls| 92c31549_4d2a_ee9b_56cd_3f0d09f7b149
  cd2b96de_ff3a_1d6e_551b_c3e1ad575cca["extractFrontmatter()"]
  13bb9435_ca50_3c2a_2cdd_91ac8adefc34 -->|calls| cd2b96de_ff3a_1d6e_551b_c3e1ad575cca
  style 13bb9435_ca50_3c2a_2cdd_91ac8adefc34 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/learn/scripts/build-llms-txt.ts lines 48–76

function getDocFiles(): DocMeta[] {
  const docsDir = path.join(process.cwd(), 'content')
  const mdxFiles = getMdxFiles(docsDir).sort((a, b) => a.localeCompare(b))

  const docs: DocMeta[] = []

  for (const fullPath of mdxFiles) {
    console.log(fullPath)
    const content = fs.readFileSync(fullPath, 'utf-8')
    const { title, description } = extractFrontmatter(content)

    if (title) {
      // Get relative path and convert to URL path
      const relativePath = path.relative(docsDir, fullPath)
      const urlPath = relativePath
        .replace(/\.mdx$/, '')
        .replace(/\/index$/, '')
        .replace(/\\/g, '/')

      docs.push({
        title,
        description,
        path: urlPath,
      })
    }
  }

  return docs
}

Subdomains

Frequently Asked Questions

What does getDocFiles() do?
getDocFiles() is a function in the supabase codebase.
What does getDocFiles() call?
getDocFiles() calls 2 function(s): extractFrontmatter, getMdxFiles.

Analyze Your Own Codebase

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

Try Supermodel Free