MCPcopy Index your code
hub / github.com/deepnote/deepnote / createMarkdown

Function createMarkdown

packages/blocks/src/markdown.ts:12–30  ·  view source on GitHub ↗
(block: DeepnoteBlock)

Source from the content-addressed store, hash-verified

10import type { DeepnoteBlock } from './deepnote-file/deepnote-file-schema'
11
12export function createMarkdown(block: DeepnoteBlock): string {
13 if (block.type === 'markdown') {
14 return block.content ?? ''
15 }
16
17 if (isTextBlock(block)) {
18 return createMarkdownForTextBlock(block)
19 }
20
21 if (isSeparatorBlock(block)) {
22 return createMarkdownForSeparatorBlock(block)
23 }
24
25 if (isImageBlock(block)) {
26 return createMarkdownForImageBlock(block)
27 }
28
29 throw new UnsupportedBlockTypeError(`Creating markdown from block type ${block.type} is not supported yet.`)
30}
31
32export function stripMarkdown(block: DeepnoteBlock): string {
33 if (isTextBlock(block)) {

Callers 5

markdown.test.tsFile · 0.90
convertBlockToCellFunction · 0.90
convertBlockToCellFunction · 0.90
getSourceForBlockFunction · 0.90
convertBlockToCellFunction · 0.90

Calls 6

isTextBlockFunction · 0.90
isSeparatorBlockFunction · 0.90
isImageBlockFunction · 0.90

Tested by

no test coverage detected