Class: MarkdownNodeParser
A NodeParser generates Nodes from Documents
Implements
Constructors
new MarkdownNodeParser()
new MarkdownNodeParser(
init
?):MarkdownNodeParser
Parameters
• init?
• init.includeMetadata?: boolean
• init.includePrevNextRel?: boolean
Returns
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:9
Properties
includeMetadata
includeMetadata:
boolean
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:6
includePrevNextRel
includePrevNextRel:
boolean
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:7
Methods
buildNodeFromSplit()
buildNodeFromSplit(
textSplit
,node
,metadata
):BaseNode
<Metadata
>
Parameters
• textSplit: string
• metadata: Metadata
Returns
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:28
getNodesFromDocuments()
Generates an array of nodes from an array of documents.
Parameters
• documents: BaseNode
<Metadata
>[]
The documents to generate nodes from.
Returns
An array of nodes.
Implementation of
NodeParser
. getNodesFromDocuments
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:101
getNodesFromNode()
Parameters
Returns
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:64
transform()
transform(
nodes
,_options
?):Promise
<BaseNode
<Metadata
>[]>
Parameters
• nodes: BaseNode
<Metadata
>[]
• _options?: any
Returns
Promise
<BaseNode
<Metadata
>[]>
Implementation of
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:17
updateMetadata()
updateMetadata(
headersMetadata
,newHeader
,newHeaderLevel
):Metadata
Parameters
• headersMetadata: Metadata
• newHeader: string
• newHeaderLevel: number
Returns
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:48
fromDefaults()
static
fromDefaults(init
?):MarkdownNodeParser
Parameters
• init?
• init.includeMetadata?: boolean
• init.includePrevNextRel?: boolean
Returns
Source
packages/llamaindex/src/nodeParsers/MarkdownNodeParser.ts:21