{ "info": { "author": "Pavlo Kapyshin", "author_email": "i@93z.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "paka.cmark\n==========\n.. image:: https://travis-ci.org/PavloKapyshin/paka.cmark.svg?branch=master\n :target: https://travis-ci.org/PavloKapyshin/paka.cmark\n\n``paka.cmark`` is a Python library that wraps subset of cmark_ C library\n(that is one of reference implementations of CommonMark).\n\n\nFeatures\n--------\n- Python 2.7 and 3.6 are supported\n- PyPy (Python 2.7) is supported, as wrapping is made with CFFI_\n- no need to install ``libcmark``, it is bundled with ``paka.cmark``\n (and sources of the former are regularly updated according to upstream)\n- supported output: HTML, XML, CommonMark, man, LaTeX\n- supported options: ``CMARK_OPT_UNSAFE``, ``CMARK_OPT_NOBREAKS``,\n ``CMARK_OPT_HARDBREAKS``, ``CMARK_OPT_SOURCEPOS``, ``CMARK_OPT_SMART``\n- unlike ``libcmark``\u2014underlying C library\u2014``paka.cmark`` uses\n ``CMARK_OPT_NOBREAKS`` by default (``breaks`` argument allows to control\n line break rendering)\n- safe HTML output is on by default (like in ``libcmark``)\n\n\nExamples\n--------\n.. code-block:: pycon\n\n >>> from paka import cmark\n\nRender with ``CMARK_OPT_DEFAULT | CMARK_OPT_NOBREAKS``:\n\n.. code-block:: pycon\n\n >>> print(cmark.to_html(u\"
nope
\"))\n \n\nRender with ``CMARK_OPT_DEFAULT | CMARK_OPT_NOBREAKS | CMARK_OPT_UNSAFE``:\n\n.. code-block:: pycon\n\n >>> print(cmark.to_html(u\"Hello,\\n*World*!\", safe=False))\nHello, World!
\n\n\nRender with ``CMARK_OPT_DEFAULT``:\n\n.. code-block:: pycon\n\n >>> print(cmark.to_html(u\"Hello,\\n*World*!\", breaks=True))\nHello,\n World!
\n\nRender with ``CMARK_OPT_DEFAULT | CMARK_OPT_HARDBREAKS``:\n\n.. code-block:: pycon\n\n >>> print(cmark.to_html(u\"Hello,\\n*World*!\", breaks=\"hard\"))\nHello,
\n World!