Class: MarkdownReader
Extract text from markdown files. Returns dictionary with keys as headers and values as the text between headers.
Implements
Constructors
constructor
• new MarkdownReader(removeHyperlinks?
, removeImages?
)
Parameters
Name | Type | Default value | Description |
---|---|---|---|
removeHyperlinks? | boolean | true | Indicates whether hyperlinks should be removed. |
removeImages? | boolean | true | Indicates whether images should be removed. |
Defined in
packages/core/src/readers/MarkdownReader.ts:19
Properties
_removeHyperlinks
• Private
_removeHyperlinks: boolean
Defined in
packages/core/src/readers/MarkdownReader.ts:12
_removeImages
• Private
_removeImages: boolean
Defined in
packages/core/src/readers/MarkdownReader.ts:13
Methods
loadData
▸ loadData(file
, fs?
): Promise
<Document
<Metadata
>[]>
Parameters
Name | Type | Default value |
---|---|---|
file | string | undefined |
fs | GenericFileSystem | DEFAULT_FS |
Returns
Implementation of
Defined in
packages/core/src/readers/MarkdownReader.ts:90
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
Name | Type | Description |
---|---|---|
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/core/src/readers/MarkdownReader.ts:30
parseTups
▸ parseTups(content
): MarkdownTuple
[]
Parameters
Name | Type |
---|---|
content | string |
Returns
MarkdownTuple
[]
Defined in
packages/core/src/readers/MarkdownReader.ts:79
removeHyperlinks
▸ removeHyperlinks(content
): string
Parameters
Name | Type |
---|---|
content | string |
Returns
string
Defined in
packages/core/src/readers/MarkdownReader.ts:74
removeImages
▸ removeImages(content
): string
Parameters
Name | Type |
---|---|
content | string |
Returns
string