python-markdown-full-yaml-metadata

This extension adds YAML meta data handling to markdown with all YAML features.

As in the original, metadata is parsed but not used in processing.

Metadata parsed as is by PyYaml and without additional transformations, so this plugin is not compatible with original Meta-Data extension.

Basic Usage

import markdown


text = """---
title: What is Lorem Ipsum?
categories:
  - Lorem Ipsum
  - Stupid content
...

Lorem Ipsum is simply dummy text.
"""

md = markdown.Markdown(extensions = ['full_yaml_metadata'])
md.convert(text) == '<p>Lorem Ipsum is simply dummy text.</p>'
md.Meta == {'title': 'What is Lorem Ipsum?', 'categories': ['Lorem Ipsum', 'Stupid content']}

Development and contribution

  • install project dependencies

    python setup.py develop

  • install linting, formatting and testing tools

    pip install -r requirements.txt

  • run tests

    pytest

  • run linters

    flake8
    mypy ./
    black --check ./

  • feel free to contribute!

GitHub

https://github.com/sivakov512/python-markdown-full-yaml-metadata