Skip to content

Add YAML file converter to MarkItDown - #2472

Open
Aditya Kumar (Aditya-k63) wants to merge 1 commit into
microsoft:mainfrom
Aditya-k63:add-yaml-converter
Open

Add YAML file converter to MarkItDown#2472
Aditya Kumar (Aditya-k63) wants to merge 1 commit into
microsoft:mainfrom
Aditya-k63:add-yaml-converter

Conversation

@Aditya-k63

Copy link
Copy Markdown

Summary

Adds a YAML file converter to MarkItDown that converts .yaml and .yml files to Markdown.

Features

  • Simple key-value pairs render as labeled blocks (**key:** value)
  • Nested mappings preserve hierarchy with bold labels
  • Sequences of mappings with uniform keys render as Markdown tables
  • Lists of scalars use bullet points
  • Multiple documents separated by --- are handled in order
  • YAML anchors and aliases are resolved
  • Flow mappings and sequences are supported
  • Empty files, scalars, deep nesting, multiline strings, and special characters handled

Files changed

  • packages/markitdown/src/markitdown/converters/_yaml_converter.py — new converter
  • packages/markitdown/src/markitdown/converters/__init__.py — register YamlConverter
  • packages/markitdown/src/markitdown/_markitdown.py — import and register YamlConverter

@Aditya-k63

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant