Skip to main content

Python wrapper for the MultiMarkdown library.

Project description

Latest Version Downloads License Code Health

pymmd

Python wrapper for MultiMarkdown, which converts MultiMarkdown flavored text into one of several outputs formats. This package directly wraps the reference implementation, and provides a simple interface to the library.

The ctypes package is used to wrap libMultiMarkdown in a portable fashion.

Installation

This package requires MultiMarkdown installed as a shared library in order to function. For Windows and macOS, the shared library is included in the distributed package.

This package can be installed via pypi:

pip install pymmd

For Linux users, the shared library can be installed by executing:

sudo python -c "import pymmd; pymmd.build_mmd('/usr/local/lib')"; sudo ldconfig

Which will install the required library and update the library cache to make it ready for operation.

Verifying the package is working as intended can be accomplished via a simple test command, which should print out the MultiMarkdown version in use:

python -c "import pymmd; print(pymmd.version())"

Examples

Converting a string of MultiMarkdown directly to various outputs:

import pymmd
# Generate string of MultiMarkdown text named data

html_output = pymmd.convert(data)
latex_output = pymmd.convert(data, fmt=pymmd.LATEX)

#Generate a snippet
html_snippet = pymmd.convert(data, ext=pymmd.SNIPPET)

Files can also be converted directly, which enables the Transclusion capabilities of MultiMarkdown.

import pymmd

#MMD file named data.mmd

html_output = pymmd.convert_from("./data.mmd")

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pymmd-0.2.0-py3-none-win_amd64.whl (112.4 kB view hashes)

Uploaded Python 3 Windows x86-64

pymmd-0.2.0-py3-none-win32.whl (96.9 kB view hashes)

Uploaded Python 3 Windows x86

pymmd-0.2.0-py3-none-macosx_10_6_intel.whl (302.0 kB view hashes)

Uploaded Python 3 macOS 10.6+ intel

pymmd-0.2.0-py3-none-any.whl (302.0 kB view hashes)

Uploaded Python 3

pymmd-0.2.0-py2-none-win_amd64.whl (114.5 kB view hashes)

Uploaded Python 2 Windows x86-64

pymmd-0.2.0-py2-none-macosx_10_6_intel.whl (302.0 kB view hashes)

Uploaded Python 2 macOS 10.6+ intel

pymmd-0.2.0-py2-none-any.whl (302.0 kB view hashes)

Uploaded Python 2

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