pub struct MarkdownLoader {
pub path: PathBuf,
pub split_by_heading: bool,
pub heading_level: usize,
}Expand description
Markdown 文档加载器
支持加载 Markdown 文件,可按标题分割为多个文档。
Fields§
§path: PathBufMarkdown 文件路径
split_by_heading: bool是否按标题分割
如果为 true,按 # 标题分割为多个文档
heading_level: usize分割的标题级别(1-6)
例如 heading_level=2 表示按 ## 分割
Implementations§
Source§impl MarkdownLoader
impl MarkdownLoader
Sourcepub fn new_with_heading_split(
path: impl Into<PathBuf>,
heading_level: usize,
) -> Self
pub fn new_with_heading_split( path: impl Into<PathBuf>, heading_level: usize, ) -> Self
Sourcepub fn with_split_by_heading(self, split: bool) -> Self
pub fn with_split_by_heading(self, split: bool) -> Self
设置是否按标题分割
Sourcepub fn with_heading_level(self, level: usize) -> Self
pub fn with_heading_level(self, level: usize) -> Self
设置标题级别
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarkdownLoader
impl RefUnwindSafe for MarkdownLoader
impl Send for MarkdownLoader
impl Sync for MarkdownLoader
impl Unpin for MarkdownLoader
impl UnsafeUnpin for MarkdownLoader
impl UnwindSafe for MarkdownLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more