Skip to main content

Markdown parsing.

Project description

Bindings for the MD4C markdown parser.

Installing

pip3 install md4c

Usage

import md4c

md4c.load(path_to_lib)

def enter_block(type, data):
    print('eb', type, '>', data)

def leave_block(type, data):
    print('lb', type, '>', data)

def enter_span(type, data):
    print('es', type, '>', data)

def leave_span(type, data):
    print('ls', type, '>', data)

def text(type, data):
    print('ls', type, '>', data)

client = md4c.Client(
    enter_block = enter_block,
    leave_block = leave_block,
    enter_span = enter_span,
    leave_span = leave_span,
    text = text
)

client.parse('is *this* `thing`\n## working?')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md4c-0.0.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

md4c-0.0.0-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page