MarkdownChef processes markdown files and strings, extracting tables, code blocks, and images into a structured MarkdownDocument.
It intelligently parses markdown content and separates it into distinct components while preserving their positions in the original text.
Installation
MarkdownChef is included in the base installation of Chonkie. No additional dependencies are required.For installation instructions, see the Installation
Guide.
Initialization
Parameters
Tokenizer to use for counting tokens in text chunks. Can be a string
identifier (“character”, “gpt2”, etc.) or a tokenizer instance that follows
the TokenizerProtocol.
Methods
process()
Process a markdown file.Parameters
Returns
MarkdownDocument containing parsed content with extracted tables, code, images, and text chunks
process_batch()
Process multiple markdown files at once.Parameters
Returns
List ofMarkdownDocument objects
Basic Usage
Return Type
MarkdownChef returns aMarkdownDocument object, which extends the base Document class with additional fields:
