INNER CODE UNIT · TypeScript

renderEntry

cyanheads/pubmed-mcp-server · scripts/build-changelog.ts:135

function renderEntry(entry: VersionEntry, fm: Frontmatter, date: string): string {
  const link = `changelog/${entry.series}/${entry.version}.md`;
  const badges = [fm.breaking ? '⚠️ Breaking' : null, fm.security ? '🛡️ Security' : null].filter(
    (b): b is string => b !== null,
  );
  const badgeSuffix = badges.length > 0 ? ` · ${badges.join(' · ')}` : '';
  const header = `## [${entry.version}](${link}) — ${date}${badgeSuffix}`;
  if (fm.summary) {
    return `${header}\n\n${fm.summary}\n`;
  }
  return `${header}\n`;
}

function collectVersionFiles(): VersionEntry[] {
  const entries: VersionEntry[] = [];
  for (const entry of readdirSync(CHANGELOG_DIR, { withFileTypes: true })) {
    if (!entry.isDirectory() || !SERIES_PATTERN.test(entry.name)) continue;
    const seriesDir = resolve(CHANGELOG_DIR, entry.name);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…