MCPcopy Index your code
hub / github.com/codeaashu/claude-code / toMarkdown

Function toMarkdown

web/lib/export/markdown.ts:49–78  ·  view source on GitHub ↗
(conv: Conversation, options: ExportOptions)

Source from the content-addressed store, hash-verified

47}
48
49export function toMarkdown(conv: Conversation, options: ExportOptions): string {
50 const lines: string[] = [
51 `# ${conv.title}`,
52 "",
53 "---",
54 ...(options.includeTimestamps
55 ? [`**Created:** ${new Date(conv.createdAt).toISOString()}`]
56 : []),
57 ...(conv.model ? [`**Model:** ${conv.model}`] : []),
58 `**Messages:** ${conv.messages.length}`,
59 "---",
60 "",
61 ];
62
63 let messages = conv.messages;
64 if (options.dateRange) {
65 const { start, end } = options.dateRange;
66 messages = messages.filter((m) => m.createdAt >= start && m.createdAt <= end);
67 }
68
69 for (const msg of messages) {
70 lines.push(renderMessage(msg, options));
71 lines.push("");
72 }
73
74 lines.push("---");
75 lines.push("*Exported from Claude Code*");
76
77 return lines.join("\n");
78}

Callers 1

POSTFunction · 0.90

Calls 2

renderMessageFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected