MCPcopy Index your code
hub / github.com/tinyplex/tinybase / extractThumbnailMarkdown

Function extractThumbnailMarkdown

site/thumbnail.ts:78–91  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

76 ].filter((markdown): markdown is string => markdown != null);
77
78export const extractThumbnailMarkdown: NodeTransform = (node) => {
79 if (node.reflection != null) {
80 node.data[THUMBNAIL] = getReflectionMarkdown(node.reflection)
81 .map((markdown) => findFirstImage(markdown))
82 .find((thumbnail) => thumbnail != null);
83 return;
84 }
85 const summaryParts = splitLeadingImage(node.summary);
86 const bodyParts = splitLeadingImage(node.body);
87 node.data[THUMBNAIL] = summaryParts.thumbnail ?? bodyParts.thumbnail;
88 node.summary = summaryParts.markdown;
89 node.body =
90 summaryParts.thumbnail == null ? bodyParts.markdown : (node.body ?? '');
91};
92
93export const getThumbnailMarkdown = (
94 node: Node,

Callers

nothing calls this directly

Calls 3

getReflectionMarkdownFunction · 0.85
findFirstImageFunction · 0.85
splitLeadingImageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…