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

Function buildPostMarkdown

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

Source from the content-addressed store, hash-verified

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

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