publish_dev_to_source.py
The markata.plugins.publish_dev_to_source
plugin enables synchronization between
your Markata posts and dev.to articles. It handles frontmatter translation and content
formatting for dev.to compatibility.
Installation
This plugin is built-in but not enabled by default. Add it to your plugins list:
hooks = [ "markata.plugins.publish_dev_to_source", ]
Uninstallation
Remove the plugin from your hooks list in markata.toml
:
hooks = [ # Remove or comment out the line below # "markata.plugins.publish_dev_to_source", ]
Configuration
No explicit configuration is required. The plugin automatically processes posts with dev.to-specific frontmatter.
Functionality
Frontmatter Mapping
Automatically maps these frontmatter fields:
- title
- published
- description
- tags
- canonical_url
- cover_image
- series
Content Processing
The plugin:
- Joins consecutive text lines for dev.to formatting
- Preserves code blocks and lists
- Maintains markdown compatibility
- Updates canonical URLs
Post Model
Extends the base Post model with:
- dev.to-specific fields
- Validation rules
- Performance optimizations
Publishing Flow
- Processes posts after rendering
- Updates frontmatter
- Formats content
- Saves changes to source files
Dependencies
This plugin depends on:
- python-frontmatter for YAML handling
- pydantic for model validation