Skip to main content

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

ParameterTypeDescriptionDefaultSource
encodingstr | NoneFile encoding (auto-detected if None)NoneBase
error_handling"ignore" | "warn" | "raise"How to handle loading errors”warn”Base
include_metadataboolWhether to include file metadataTrueBase
custom_metadatadictAdditional metadata to includeBase
max_file_sizeint | NoneMaximum file size in bytesNoneBase
skip_empty_contentboolSkip documents with empty contentTrueBase
parse_front_matterboolParse YAML front matterTrueSpecific
include_code_blocksboolInclude code block contentTrueSpecific
code_block_language_metadataboolAdd code block language as metadataTrueSpecific
heading_metadataboolExtract headings and add to metadataTrueSpecific
split_by_heading"h1" | "h2" | "h3" | NoneSplit file by heading levelNoneSpecific