Skip to main content

Python wrapper for the MultiMarkdown library.

Project description

.. image:: https://img.shields.io/pypi/v/pymmd.svg
:target: https://pypi.python.org/pypi/pymmd/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/dm/pymmd.svg
:target: https://pypi.python.org/pypi/pymmd/
:alt: Downloads
.. image:: https://img.shields.io/pypi/l/pymmd.svg
:target: https://pypi.python.org/pypi/pymmd/
:alt: License
.. image:: https://landscape.io/github/jasedit/pymmd/master/landscape.svg?style=flat
:target: https://landscape.io/github/jasedit/pymmd/master/
:alt: Code Health

pymmd
============

Python wrapper for `MultiMarkdown <https://github.com/fletcher/MultiMarkdown-5>`_, 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 <https://docs.python.org/2/library/ctypes.html>`_ 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:

.. code:: bash

pip install pymmd

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

.. code:: bash

python -c "import pymmd; pymmd.build_mmd()"

Which will download, build, and install the required library within the package's directory. This may need to be run with `sudo` if the package is installed to a system-level site-packages directory.

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

.. code:: bash

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

Examples
=============

Converting a string of MultiMarkdown directly to various outputs:

.. code:: python

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)

Conversion can be performed with the `Transclusion <http://fletcher.github.io/MultiMarkdown-5/transclusion>`_ capabilities of MultiMarkdown, either by specifying the directory name:

.. code:: python
import pymmd

with open('./document.mmd') as fp:
src = fp.read()
output = pymmd.convert(src, dname='.')

Files can also be converted directly from file:

.. code:: python

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.4.0-py3-none-win_amd64.whl (115.3 kB view details)

Uploaded Python 3 Windows x86-64

pymmd-0.4.0-py3-none-win32.whl (99.8 kB view details)

Uploaded Python 3 Windows x86

pymmd-0.4.0-py3-none-macosx_10_6_intel.whl (303.4 kB view details)

Uploaded Python 3 macOS 10.6+ intel

pymmd-0.4.0-py2.py3-none-any.whl (303.4 kB view details)

Uploaded Python 2 Python 3

pymmd-0.4.0-py2-none-win_amd64.whl (115.4 kB view details)

Uploaded Python 2 Windows x86-64

pymmd-0.4.0-py2-none-win32.whl (99.8 kB view details)

Uploaded Python 2 Windows x86

pymmd-0.4.0-py2-none-macosx_10_6_intel.whl (303.4 kB view details)

Uploaded Python 2 macOS 10.6+ intel

File details

Details for the file pymmd-0.4.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 586556ea44ef9a23c3937ec0872700d82a09eb6fb512fe94b03f540ec8612b8f
MD5 2eb22b29cdd59d74183552f81924e94c
BLAKE2b-256 206ca9a401d97cd684e53fc3407e796614febde12c58c4ce04b9bd89e272d8f7

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py3-none-win32.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 f3607fb561ee5f39c90c2b965424bfc869b661d34637795e4fc13ac9d622c393
MD5 124f1b519392f279f5937d8d48a8f49d
BLAKE2b-256 be11af715751a152b5d0d959ebe06f138d5c707d2014cbd324395dcb2433d5f6

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py3-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py3-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 ec32b22e578710c3121e2719096dd3e5811a45c38dea368aeb74f2d8adb4a0ca
MD5 3e7141d1d29392b131c74a92f06b4709
BLAKE2b-256 e6717dba5a0202602c4628223edaa862c637de0ddaad4526a3845e45d57942a0

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8bb54ef82ccfc0aaa968584b71306d5b92f823a6badd22a083297a88480dc177
MD5 8757a17fdc0b7b975e6d1bd12e82ea41
BLAKE2b-256 746fa6e07702eaffccbd12dddf054dbe34ef46562ea4f2c875deb893b599133e

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py2-none-win_amd64.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py2-none-win_amd64.whl
Algorithm Hash digest
SHA256 840f0859b3045158f96b9fb529d481b2dd38fb929e610ce3da6f364647235559
MD5 54eb257cd9ff1e40f341b2d0b4bf8d6a
BLAKE2b-256 ceca7e164d0d1d9380dd022d5c9542ed5b92999fb951f7bae516806d6de0010a

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py2-none-win32.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py2-none-win32.whl
Algorithm Hash digest
SHA256 ca611be1d99672dcfa338e9d46ca40644dc0ba59cca8e57d8628696cb6edbfcf
MD5 3040c96e4b1f47485e280ab7c19c1d98
BLAKE2b-256 c6f6ad083658e83952b27e653e7f4c7f02116ccc4acd267b22cc93c7f8742808

See more details on using hashes here.

File details

Details for the file pymmd-0.4.0-py2-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for pymmd-0.4.0-py2-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 a10adc711d5722f59b562b68a4b2d44f02062758159e3e5d4953e09783d62a21
MD5 c9c7becd33ba4a63ea299d5fc9c3c5f9
BLAKE2b-256 a25c364ca32a830c9f8ac26217cd1a8daed2a7b7d510056c4341bab976bc6207

See more details on using hashes here.

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