MarkdownReader
Defined in: packages/readers/src/markdown.ts:9
Extract text from markdown files. Returns dictionary with keys as headers and values as the text between headers.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MarkdownReader(
removeHyperlinks?,removeImages?):MarkdownReader
Defined in: packages/readers/src/markdown.ts:17
Parameters
Section titled “Parameters”removeHyperlinks?
Section titled “removeHyperlinks?”boolean = true
Indicates whether hyperlinks should be removed.
removeImages?
Section titled “removeImages?”boolean = true
Indicates whether images should be removed.
Returns
Section titled “Returns”MarkdownReader
Overrides
Section titled “Overrides”Methods
Section titled “Methods”loadData()
Section titled “loadData()”Defined in: packages/core/src/schema/type.ts:65
Parameters
Section titled “Parameters”filePath
Section titled “filePath”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”addMetaData()
Section titled “addMetaData()”
staticaddMetaData(filePath): (doc,index) =>void
Defined in: packages/core/src/schema/type.ts:94
Parameters
Section titled “Parameters”filePath
Section titled “filePath”string
Returns
Section titled “Returns”(
doc,index):void
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”markdownToTups()
Section titled “markdownToTups()”markdownToTups(
markdownText):MarkdownTuple[]
Defined in: packages/readers/src/markdown.ts:29
Convert a markdown file to a dictionary. The keys are the headers and the values are the text under each header.
Parameters
Section titled “Parameters”markdownText
Section titled “markdownText”string
The markdown text to convert.
Returns
Section titled “Returns”MarkdownTuple[]
- An array of tuples, where each tuple contains a header (or null) and its corresponding text.
removeImages()
Section titled “removeImages()”removeImages(
content):string
Defined in: packages/readers/src/markdown.ts:70
Parameters
Section titled “Parameters”content
Section titled “content”string
Returns
Section titled “Returns”string
removeHyperlinks()
Section titled “removeHyperlinks()”removeHyperlinks(
content):string
Defined in: packages/readers/src/markdown.ts:75
Parameters
Section titled “Parameters”content
Section titled “content”string
Returns
Section titled “Returns”string
parseTups()
Section titled “parseTups()”parseTups(
content):MarkdownTuple[]
Defined in: packages/readers/src/markdown.ts:80
Parameters
Section titled “Parameters”content
Section titled “content”string
Returns
Section titled “Returns”MarkdownTuple[]
loadDataAsContent()
Section titled “loadDataAsContent()”loadDataAsContent(
fileContent):Promise<Document<Metadata>[]>
Defined in: packages/readers/src/markdown.ts:91
Parameters
Section titled “Parameters”fileContent
Section titled “fileContent”Uint8Array