Python wrapper for the MultiMarkdown library.
Project description
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. Currently, this can be installed by installing MultiMarkdown from this branch, and installing the package with the shared option enabled. This installs the shared library version of libMultiMarkdown which can be called by this wrapper.
Once the shared library is installed, this package can be installed via pypi:
pip install pymmd
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
Built Distributions
Hashes for pymmd-0.1.2-py3-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e95b774355d8655ba87b32846db6186509612802990e9abbfb7356cf9163066 |
|
MD5 | 49d802c07e049b3c06ae483f34fb0540 |
|
BLAKE2b-256 | 1d246240ada097f3fe8bad624a1a417a4f19e0b2d10e26564a84fb17817c9d27 |
Hashes for pymmd-0.1.2-py2-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42087bab4f53da02a03978e29cd0dda715befb0859928d71ecd5e51170bb7663 |
|
MD5 | 6d0b5b1761daffe814eaa2771c7ab1b7 |
|
BLAKE2b-256 | e2a7b75ef902308674dfa832a89b7dedaa51db76697bdffc7de76d899abe08e9 |
Hashes for pymmd-0.1.2-py2-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16aab93284b6a265d5c5f659b28cd296102aee1bf002577739b220796260a4e6 |
|
MD5 | a84611696bda09ccfb0e51b3d90fd2d1 |
|
BLAKE2b-256 | 47317bc08d36b4c6fcfa65faac1e69e9eb58f68de4fcfd411dc84d53305de7be |