Overview
Markdown loader processes Markdown files with support for YAML front matter parsing, code block extraction, and heading-based document splitting. Preserves structure and metadata. Loader Class:MarkdownLoader
Config Class: MarkdownLoaderConfig
Install
Install the Markdown loader optional dependency group:
Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
encoding | str | None | File encoding (auto-detected if None) | None | Base |
error_handling | "ignore" | "warn" | "raise" | How to handle loading errors | ”warn” | Base |
include_metadata | bool | Whether to include file metadata | True | Base |
custom_metadata | dict | Additional metadata to include | Base | |
max_file_size | int | None | Maximum file size in bytes | None | Base |
skip_empty_content | bool | Skip documents with empty content | True | Base |
parse_front_matter | bool | Parse YAML front matter | True | Specific |
include_code_blocks | bool | Include code block content | True | Specific |
code_block_language_metadata | bool | Add code block language as metadata | True | Specific |
heading_metadata | bool | Extract headings and add to metadata | True | Specific |
split_by_heading | "h1" | "h2" | "h3" | None | Split file by heading level | None | Specific |

