INNER CODE UNIT · TypeScript

parseSessionFilename

winstonkoh87/Athena-Public · supabase/functions/sync-athena/index.ts:86

function parseSessionFilename(filename: string): { date: string; sessionNum: number } | null {
  const match = filename.match(/(\d{4}-\d{2}-\d{2})-session-(\d+)\.md/);
  if (match) {
    return { date: match[1], sessionNum: parseInt(match[2]) };
  }
  return null;
}

// Extract title from markdown
function extractTitle(content: string): string {
  const lines = content.split("\n");
  for (const line of lines) {
    if (line.startsWith("# ")) {
      return line.slice(2).trim();
    }
  }
  return "Untitled";
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…