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. 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:
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:
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 Distribution
Built Distributions
Hashes for pymmd-0.3.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de3b6b5ebbe353b27cb6a902b5d856187a46133bc6052d135c1b73b545704766 |
|
MD5 | 354ab47aa631b660632b2cc18ab25662 |
|
BLAKE2b-256 | 7f82e9d082b1242cf38e97d23b8e56c93baa84e9bfd3c3e6f18b05b28fc59946 |
Hashes for pymmd-0.3.0-py3-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a9751a21aba72866b85996785dc48c69d31c7701ab1a317c9e1a84238172f08 |
|
MD5 | aeebaacd1f844dd74e1bce07c4240269 |
|
BLAKE2b-256 | 1b01c1cb122d64a407a0bb2ef303f097809d2d28471342dbf9280bf68cd2b14a |
Hashes for pymmd-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce7a38b03c3c6fbb5996ecf7f31127d9c9fced0119c42bd242ff6e7b1c2d523 |
|
MD5 | a0b7671dc5e75673d09db281485b24c4 |
|
BLAKE2b-256 | 02f14b1ca0de7d9143465e0a6b9d3430cf9cc3ba8f130f897c6f9b13481aaa30 |
Hashes for pymmd-0.3.0-py2-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ca41b4fa82a7b63bfa1f2dd00d24ec81c0abccd0fb93a40c29b3a1ee123c37 |
|
MD5 | ed7a0b3d2c168ea3017d346b92064008 |
|
BLAKE2b-256 | 707e507cdbe6d1b19578c561c34db635034cad0a102c3ea939768cc0421c5745 |
Hashes for pymmd-0.3.0-py2-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50b2e60f8f50f538f0bb82ee2545f1e6c77a09c7d0dfad6b0f9e9059968c3387 |
|
MD5 | cdc85fd18782cbf6d5d30972f79ecea7 |
|
BLAKE2b-256 | bd715c2aa55945f498895324710d8bad130e54cfa12d4fb8bb99a92d24d8280e |