Skip to content

BlockSuite API Documentation / @blocksuite/blocks / MarkdownAdapter

Class: MarkdownAdapter

Extends

Constructors

new MarkdownAdapter(undefined)

new MarkdownAdapter(): MarkdownAdapter

Returns

MarkdownAdapter

Inherited from

@blocksuite/store.BaseAdapter.constructor

Properties

configs

protected configs: Map<string, unknown>

Inherited from

@blocksuite/store.BaseAdapter.configs

Source

packages/framework/store/dist/adapter/base.d.ts:41

Methods

_astToMarkdown()

private _astToMarkdown(ast): string

Parameters

ast: Root

Returns

string

Source

packages/blocks/src/_common/adapters/markdown.ts:1011


_deltaToMdAST()

private _deltaToMdAST(deltas, depth): (Text | Link | Strong | Delete | Emphasis | InlineCode)[]

Parameters

deltas: DeltaInsert[]

depth: number= 0

Returns

(Text | Link | Strong | Delete | Emphasis | InlineCode)[]

Source

packages/blocks/src/_common/adapters/markdown.ts:1025


_markdownToAst()

private _markdownToAst(markdown): Root

Parameters

markdown: string

Returns

Root

Source

packages/blocks/src/_common/adapters/markdown.ts:1021


_mdastToDelta()

private _mdastToDelta(ast): DeltaInsert[]

Parameters

ast: MarkdownAST

Returns

DeltaInsert[]

Source

packages/blocks/src/_common/adapters/markdown.ts:1078


_traverseMarkdown()

private _traverseMarkdown(markdown, snapshot, assets?): Promise<BlockSnapshot>

Parameters

markdown: MarkdownAST

snapshot: BlockSnapshot

assets?: AssetsManager

Returns

Promise<BlockSnapshot>

Source

packages/blocks/src/_common/adapters/markdown.ts:675


_traverseSnapshot()

private _traverseSnapshot(snapshot, markdown, assets?): Promise<Object>

Parameters

snapshot: BlockSnapshot

markdown: MarkdownAST

assets?: AssetsManager

Returns

Promise<Object>

assetsIds

assetsIds: string[]

ast

ast: Root

Source

packages/blocks/src/_common/adapters/markdown.ts:245


applyConfigs()

applyConfigs(configs): void

Parameters

configs: Map<string, unknown>

Returns

void

Inherited from

@blocksuite/store.BaseAdapter.applyConfigs

Source

packages/framework/store/dist/adapter/base.d.ts:48


fromBlockSnapshot()

fromBlockSnapshot(__namedParameters): Promise<FromBlockSnapshotResult<string>>

Parameters

__namedParameters: FromBlockSnapshotPayload

Returns

Promise<FromBlockSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromBlockSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:72


fromPageSnapshot()

fromPageSnapshot(__namedParameters): Promise<FromPageSnapshotResult<string>>

Parameters

__namedParameters: FromPageSnapshotPayload

Returns

Promise<FromPageSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromPageSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:56


fromSliceSnapshot()

fromSliceSnapshot(__namedParameters): Promise<FromSliceSnapshotResult<string>>

Parameters

__namedParameters: FromSliceSnapshotPayload

Returns

Promise<FromSliceSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromSliceSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:91


toBlockSnapshot()

toBlockSnapshot(payload): Promise<BlockSnapshot>

Parameters

payload: ToBlockSnapshotPayload<string>

Returns

Promise<BlockSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toBlockSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:177


toPageSnapshot()

toPageSnapshot(payload): Promise<PageSnapshot>

Parameters

payload: ToPageSnapshotPayload<string>

Returns

Promise<PageSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toPageSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:118


toSliceSnapshot()

toSliceSnapshot(payload): Promise<null | SliceSnapshot>

Parameters

payload: MarkdownToSliceSnapshotPayload

Returns

Promise<null | SliceSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toSliceSnapshot

Source

packages/blocks/src/_common/adapters/markdown.ts:201


Generated using TypeDoc and typedoc-plugin-markdown.