Plugin Architecture
MarkItDown uses themarkitdown.plugin entry point group to discover plugins. When enable_plugins=True, MarkItDown calls each plugin’s register_converters() function during initialization.
Plugins are disabled by default. Users must explicitly enable them with
enable_plugins=True or the --use-plugins CLI flag.Creating a Plugin
Complete Example: RTF Plugin
Here’s the complete RTF converter plugin frompackages/markitdown-sample-plugin/:
Installing and Testing Your Plugin
Writing Plugin Tests
Create tests to verify both direct converter usage and plugin loading:Plugin Loading Process
MarkItDown loads plugins using this process (_markitdown.py:65):
- When
enable_plugins=True, MarkItDown callsenable_plugins()method _load_plugins()discovers allmarkitdown.pluginentry points- Each entry point is loaded and its
register_converters()function is called - If any plugin fails to load, a warning is issued and the plugin is skipped
Best Practices
Publishing Your Plugin
To share your plugin with others:- Naming Convention: Use
markitdown-<name>-pluginfor package name - PyPI Publishing: Follow standard Python package publishing process
- Documentation: Include clear installation and usage instructions
- Testing: Ensure comprehensive test coverage
Next Steps
Custom Converters
Learn more about implementing converters
Configuration
Understand MarkItDown configuration options