Skip to main content
Glama
format.ts575 B
/** * 格式化工具函数 * 用于处理内容转换和格式化 */ /** * 从块内容中提取标题 */ export function extractTitle(content: string): string { if (!content) return 'Untitled'; // 移除Markdown标记,只保留文本,取前50字符 return content.replace(/^#+\s*/, '').trim().substring(0, 50); } /** * 截取内容作为摘要 */ export function truncateContent(content: string, maxLength: number): string { if (!content) return ''; if (content.length <= maxLength) return content; return content.substring(0, maxLength) + '...'; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/porkll/siyuan-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server