MCPcopy Create free account
hub / github.com/dailydotdev/apps / buildPostMarkdown

Function buildPostMarkdown

packages/webapp/lib/postMarkdown.ts:547–576  ·  view source on GitHub ↗
({
  post,
  comments,
  similarPosts,
}: PostMarkdownInput)

Source from the content-addressed store, hash-verified

545}
546
547export const buildPostMarkdown = ({
548 post,
549 comments,
550 similarPosts,
551}: PostMarkdownInput): string => {
552 const title = post.title || post.sharedPost?.title || 'Untitled';
553
554 const lines = [
555 ...buildFrontmatter(post),
556 '',
557 '> ## Documentation Index',
558 `> Fetch the complete documentation index at: ${getLlmsTxtUrl()}`,
559 '> Use this file to discover all available pages before exploring further.',
560 '',
561 `# ${title}`,
562 '',
563 buildByline(post),
564 '',
565 ...buildSummary(post),
566 ...buildBody(post),
567 '',
568 ...buildAnsweredQuestions(post),
569 ...buildCommunityTake(post),
570 ...buildComments(comments),
571 ...buildSimilarPosts(similarPosts),
572 ...buildFooter(post),
573 ];
574
575 return `${lines.join('\n').replace(/\n{3,}/g, '\n\n')}\n`;
576};

Callers 2

handlerFunction · 0.90
buildFunction · 0.90

Calls 11

getLlmsTxtUrlFunction · 0.90
buildFrontmatterFunction · 0.85
buildBylineFunction · 0.85
buildSummaryFunction · 0.85
buildBodyFunction · 0.85
buildAnsweredQuestionsFunction · 0.85
buildCommunityTakeFunction · 0.85
buildCommentsFunction · 0.85
buildSimilarPostsFunction · 0.85
buildFooterFunction · 0.85
replaceMethod · 0.80

Tested by 1

buildFunction · 0.72