Class: MarkdownReader
Extract text from markdown files. Returns dictionary with keys as headers and values as the text between headers.
Extends
Constructors
new MarkdownReader()
new MarkdownReader(
removeHyperlinks
?,removeImages
?):MarkdownReader
Parameters
• removeHyperlinks?: boolean
Indicates whether hyperlinks should be removed.
• removeImages?: boolean
Indicates whether images should be removed.
Returns
Overrides
Defined in
packages/readers/markdown/dist/index.d.ts:15
Methods
loadData()
Parameters
• filePath: string
Returns
Inherited from
Defined in
packages/core/schema/dist/index.d.ts:188
loadDataAsContent()
loadDataAsContent(
fileContent
):Promise
<Document
<Metadata
>[]>
Parameters
• fileContent: Uint8Array
<ArrayBufferLike
>
Returns
Overrides
Defined in
packages/readers/markdown/dist/index.d.ts:26
markdownToTups()
markdownToTups(
markdownText
):MarkdownTuple
[]
Convert a markdown file to a dictionary. The keys are the headers and the values are the text under each header.
Parameters
• markdownText: string
The markdown text to convert.
Returns
MarkdownTuple
[]
- An array of tuples, where each tuple contains a header (or null) and its corresponding text.
Defined in
packages/readers/markdown/dist/index.d.ts:22
parseTups()
parseTups(
content
):MarkdownTuple
[]
Parameters
• content: string
Returns
MarkdownTuple
[]
Defined in
packages/readers/markdown/dist/index.d.ts:25
removeHyperlinks()
removeHyperlinks(
content
):string
Parameters
• content: string
Returns
string
Defined in
packages/readers/markdown/dist/index.d.ts:24
removeImages()
removeImages(
content
):string
Parameters
• content: string
Returns
string
Defined in
packages/readers/markdown/dist/index.d.ts:23
addMetaData()
static
addMetaData(filePath
): (doc
,index
) =>void