Aller au contenu principal

Class: MarkdownNodeParser

A NodeParser generates Nodes from Documents

Implements

Constructors

constructor

new MarkdownNodeParser(init?): MarkdownNodeParser

Parameters

NameType
init?Object
init.includeMetadata?boolean
init.includePrevNextRel?boolean

Returns

MarkdownNodeParser

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:9

Properties

includeMetadata

includeMetadata: boolean

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:6


includePrevNextRel

includePrevNextRel: boolean

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:7

Methods

buildNodeFromSplit

buildNodeFromSplit(textSplit, node, metadata): BaseNode<Metadata>

Parameters

NameType
textSplitstring
nodeBaseNode<Metadata>
metadataMetadata

Returns

BaseNode<Metadata>

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:28


getNodesFromDocuments

getNodesFromDocuments(documents): BaseNode<Metadata>[]

Generates an array of nodes from an array of documents.

Parameters

NameTypeDescription
documentsBaseNode<Metadata>[]The documents to generate nodes from.

Returns

BaseNode<Metadata>[]

An array of nodes.

Implementation of

NodeParser.getNodesFromDocuments

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:101


getNodesFromNode

getNodesFromNode(node): BaseNode<Metadata>[]

Parameters

NameType
nodeBaseNode<Metadata>

Returns

BaseNode<Metadata>[]

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:64


transform

transform(nodes, _options?): Promise<BaseNode<Metadata>[]>

Parameters

NameType
nodesBaseNode<Metadata>[]
_options?any

Returns

Promise<BaseNode<Metadata>[]>

Implementation of

NodeParser.transform

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:17


updateMetadata

updateMetadata(headersMetadata, newHeader, newHeaderLevel): Metadata

Parameters

NameType
headersMetadataMetadata
newHeaderstring
newHeaderLevelnumber

Returns

Metadata

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:48


fromDefaults

fromDefaults(init?): MarkdownNodeParser

Parameters

NameType
init?Object
init.includeMetadata?boolean
init.includePrevNextRel?boolean

Returns

MarkdownNodeParser

Defined in

packages/core/src/nodeParsers/MarkdownNodeParser.ts:21