Home / Function/ extractFrontmatter() — supabase Function Reference

extractFrontmatter() — supabase Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

apps/learn/scripts/build-llms-txt.ts lines 15–28

function extractFrontmatter(content: string): { title?: string; description?: string } {
  const frontmatterRegex = /---\n([\s\S]*?)\n---/
  const match = content.match(frontmatterRegex)
  if (!match) return {}

  const frontmatter = match[1]
  const titleMatch = frontmatter.match(/title:\s*(.*)/)
  const descriptionMatch = frontmatter.match(/description:\s*(.*)/)

  return {
    title: titleMatch?.[1],
    description: descriptionMatch?.[1],
  }
}

Subdomains

Called By

Frequently Asked Questions

What does extractFrontmatter() do?
extractFrontmatter() is a function in the supabase codebase.
What calls extractFrontmatter()?
extractFrontmatter() is called by 1 function(s): getDocFiles.

Analyze Your Own Codebase

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

Try Supermodel Free