{
"info": {
"author": "GovReady PBC",
"author_email": "",
"bugtrack_url": null,
"classifiers": [
"Intended Audience :: Developers",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "CommonMark-py-Extensions\n========================\n\nThis package extends the [commonmark](https://github.com/rtfd/CommonMark-py) CommonMark rendering library for Python with:\n\n* Tables in [GitHub Flavored Markdown](https://github.github.com/gfm/#tables-extension-), with a futher extension for multi-line table cells that support\nembedded block markup.\n* A new renderer to convert CommonMark to plain text that is prettier than the original CommonMark, and a renderer that turns CommonMark back into CommonMark again.\n\nThis library is tightly linked to the commonmark internals and has been tested only with `commonmark==0.8.0`.\n\nNOTE: This project is a work-in-progress. It is closely compatible with GitHub Flavored Markdown but deviates a bit in edge cases and block-end rules.\n\nInstallation\n------------\n\n\tpip install commonmarkextensions\n\nUsage\n-----\n\n### Tables\n\nUsage is similar to the upstream library. To render tables:\n\n```python\n>>> import commonmark_extensions.tables\n>>> commonmark_extensions.tables.commonmark(\"\"\"\n... | Header 1 | Header 2 |\n... | -------- | -------- |\n... | Cells | **can** |\n... | `have` | inlines. |\n... \"\"\")\n'
\\n\\n\\n| Header 1 | \\nHeader 2 | \\n
\\n\\n\\n\\n| Cells | \\ncan | \\n
\\n\\nhave | \\ninlines. | \\n
\\n\\n
\\n'\n```\n\nColumn text alignment is set with `:` as per GitHub Flavored Markdown tables. This example sets the first column to be right aligned and the second column to be center-aligned:\n\n```markdown\n| Sample | Header |\n| -----: | :----: |\n| A | **bold** |\n| C | D |\n```\n\nThe tables extension also accepts our own multi-line cell format, in which cells can hold embedded block formatting (e.g. paragraphs\nand lists within cells). Use `=` instead of `-` below the header and then separate all rows with rows of `=`s (optionally ending the table with another row of `=`s), as in:\n\n```python\nmarkup = \"\"\"\n| Sample | Header |\n| ====== | ====== |\n| * A | * B |\n| * C | * D |\n| ====== | ====== |\n| > C | D |\n| ====== | ====== |\n\"\"\"\n```\n\nThe resulting HTML is:\n\n```html\n\n\n\n| Sample | \nHeader | \n
\n\n\n\n| \n | \n\n | \n
\n\n\nC \n \n | \nD | \n
\n\n
\n```\n\n### Plain text\n\nThe library also includes new renderers for plain text and for outputting back to CommonMark. Most of the\ninput is left unchanged by these renderers. E.g. `*Italic*` in the input is rendered as `*Italic*` in the\noutput. But some CommonMark formatting --- especially links --- is confusing for non-technical end users.\nThe plain text renderer fixes up and normalizes markup:\n\n* Links appear more friendly than in the []() notation.\n* Indentation is normalized.\n* There are many ways to specify a heading in CommonMark, so heading styles are normalized in the output.\n* Entity references like \"Ӓ\" are turned into Unicode characters.\n\nUse the plain text renderer as follows:\n\n```python\n>>> import commonmark_extensions.plaintext\n>>> pt = commonmark_extensions.plaintext.commonmark(\"\"\"\n... # Good morning!\n... \n... See [our website](https://www.govready.com) for details.\n... \"\"\")\n>>> print(pt)\n```\n\nwhich generates\n\n```text\nGood morning!\n#############\n\nSee our website for details.\n```\n\nThe CommonMark-to-CommonMark renderer can only be used by instantiating a parser and renderer --- see below.\n\nLimitations:\n\n* The html_inline and html_block nodes are not supported and will raise a RawHtmlNotAllowed exception.\n* Images are rendered as \"[image]\" plus their alt text.\n\nAdvanced Usage\n--------------\n\nYou can also instantiate (and subclass, if you like) the parser and renderers separately:\n\n### Advanced Usage for Tables\n\n```python\nmarkup = \"\"\"\n| Sample | Header |\n| -----: | :----: |\n| A | **bold** |\n| C | D |\n\"\"\"\n\nfrom commonmark_extensions.tables import ParserWithTables, RendererWithTables\nparser = ParserWithTables()\nast = parser.parse(markup)\nprint(RendererWithTables().render(ast))\n```\n\nThis outputs:\n\n```html\n\n\n\n| Sample | \nHeader | \n
\n\n\n\n| A | \nbold | \n
\n\n| C | \nD | \n
\n\n
\n```\n\n### Advanced Usage for Plain Text\n\nPlain text rendering using a parser and renderer:\n\n```python\nimport commonmark\nfrom commonmark_extensions.plaintext import PlainTextRenderer\nparser = commonmark.Parser()\nast = parser.parse(markup)\nprint(PlainTextRenderer().render(ast))\n```\n\nThere is a second renderer for generating CommonMark, i.e. normalizing the input CommonMark\ninto more CommonMark.\n\n```python\n>>> markup = \"\"\"\n... # Good morning!\n... \n... See [our website](https://www.govready.com) for details.\n... \"\"\"\n>>> import commonmark\n>>> from commonmark_extensions.plaintext import CommonMarkToCommonMarkRenderer\n>>> parser = commonmark.Parser()\n>>> ast = parser.parse(markup)\n>>> print(CommonMarkToCommonMarkRenderer().render(ast))\nGood morning\\!\n==============\n\nSee [our website](https://www.govready.com) for details.\n```\n\nThe CommonMarkToCommonMarkRenderer is pretty good but is not complete. It also has some additional limitations: it over-zealously backslash-escapes punctuation characters because it can't tell when it would be safe to not do so, lists next to each other may be combined, the loose/tight distinction of lists is not captured in output.\n\nTests\n-----\n\nThere is no reference output for what the plain text renderer should produce. But I've saved the output of all of the CommonMark spec examples into `reference_output.txt` so that as this library evolves we can see changes. To check for consistency with previous output of this library, run::\n\n python3 commonmark_extensions/make_reference_output.py > reference_output.txt\n git diff\n\nThe PlainTextRenderer is tested by round-tripping CommonMark (parsing, then outputing it as CommonMark), and then parsing that and outputting to HTML. The final HTML should match the HTML that you'd get from just rendering to HTML in one step. \n\n\nFor Project Maintainers\n-----------------------\n\nTo publish a universal wheel to pypi::\n\n pip3 install twine\n rm -rf dist\n python3 setup.py sdist bdist_wheel --universal\n twine upload dist/*\n git tag v1.0.XXX\n git push --tags\n\n\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/GovReady/CommonMark-py-Extensions",
"keywords": "markdown commonmark tables plaintext",
"license": "BSD 3",
"maintainer": "",
"maintainer_email": "",
"name": "commonmarkextensions",
"package_url": "https://pypi.org/project/commonmarkextensions/",
"platform": "",
"project_url": "https://pypi.org/project/commonmarkextensions/",
"project_urls": {
"Homepage": "https://github.com/GovReady/CommonMark-py-Extensions"
},
"release_url": "https://pypi.org/project/commonmarkextensions/0.0.5/",
"requires_dist": [
"commonmark (<=0.8.1,>=0.8.0)"
],
"requires_python": "",
"summary": "Tables and plain text rendering extension to commonmark.",
"version": "0.0.5"
},
"last_serial": 4710133,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "c1bf09398f5709d1a4fc7f6786afc452",
"sha256": "ce01ca77596f0db46bd1dc5332dffeb2eeaf00bc7fea3dc8b0926b0f3aa5f7d0"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1bf09398f5709d1a4fc7f6786afc452",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 17820,
"upload_time": "2017-11-03T16:05:31",
"url": "https://files.pythonhosted.org/packages/6c/04/c731d2728c4848c96d0b8a117dc653b651521124083fc3eb740bdec62917/commonmarkextensions-0.0.1-py2.py3-none-any.whl"
}
],
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "73e50490d4fd9c3a817d9354eb0f0c98",
"sha256": "5f7775e2fd53d2649fa88b53f17806bbedd7aecd1d75025ab394d586a22f95f8"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "73e50490d4fd9c3a817d9354eb0f0c98",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 18066,
"upload_time": "2017-12-03T19:39:10",
"url": "https://files.pythonhosted.org/packages/b6/9f/e35a14ba3ad356096d2d25ef4034f5d8ee177ab1f311d4657f9e1610830b/commonmarkextensions-0.0.2-py2.py3-none-any.whl"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "bc0f8993cbdeb0cf731e0dfe609feea9",
"sha256": "3289f2bddadd1e8f3ecde814a7c31cb8fb9b8ea8745b54838a0a946cb3743fc0"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc0f8993cbdeb0cf731e0dfe609feea9",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 18044,
"upload_time": "2018-03-15T21:17:21",
"url": "https://files.pythonhosted.org/packages/e9/a7/20fb5a4a00dc3227c28f9f532d5720567d337c8cf7d6950015c694c4d2e1/commonmarkextensions-0.0.3-py2.py3-none-any.whl"
}
],
"0.0.4": [
{
"comment_text": "",
"digests": {
"md5": "19a9cce4fc6ff3751dbed1bf60035621",
"sha256": "e00a596094d7484f0e805d91f6efa00172f1f008cfadc0038221607513d4f733"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "19a9cce4fc6ff3751dbed1bf60035621",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 18006,
"upload_time": "2018-09-03T21:26:35",
"url": "https://files.pythonhosted.org/packages/ea/cd/7eea03a9dd4d7752dd51e1b70a17784d9b46c899729f12657b58e7473bf9/commonmarkextensions-0.0.4-py2.py3-none-any.whl"
}
],
"0.0.5": [
{
"comment_text": "",
"digests": {
"md5": "545a4a35b386db268871e1c8c49615f4",
"sha256": "be1fe5562a81051fd3e06e23cd2300bd4506ac0041d91189508e1627fd5cd846"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "545a4a35b386db268871e1c8c49615f4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 26069,
"upload_time": "2019-01-17T23:19:39",
"url": "https://files.pythonhosted.org/packages/5f/e4/4ba4db5d57714a5e64c5241470b178aae2bb13bddf7e036577c8cc0d9343/commonmarkextensions-0.0.5-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "9e2137fa9100392b90a0a6023a4255bd",
"sha256": "35cb6f5fc42f7f36834371c857bc34e29599ff329438bd715f3081c6b8ec0fbb"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "9e2137fa9100392b90a0a6023a4255bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14004,
"upload_time": "2019-01-17T23:19:41",
"url": "https://files.pythonhosted.org/packages/59/17/ea0f79c9ef42622d6018241e0844ff79403fa14402b6019a502e149600e5/commonmarkextensions-0.0.5.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "545a4a35b386db268871e1c8c49615f4",
"sha256": "be1fe5562a81051fd3e06e23cd2300bd4506ac0041d91189508e1627fd5cd846"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "545a4a35b386db268871e1c8c49615f4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 26069,
"upload_time": "2019-01-17T23:19:39",
"url": "https://files.pythonhosted.org/packages/5f/e4/4ba4db5d57714a5e64c5241470b178aae2bb13bddf7e036577c8cc0d9343/commonmarkextensions-0.0.5-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "9e2137fa9100392b90a0a6023a4255bd",
"sha256": "35cb6f5fc42f7f36834371c857bc34e29599ff329438bd715f3081c6b8ec0fbb"
},
"downloads": -1,
"filename": "commonmarkextensions-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "9e2137fa9100392b90a0a6023a4255bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14004,
"upload_time": "2019-01-17T23:19:41",
"url": "https://files.pythonhosted.org/packages/59/17/ea0f79c9ef42622d6018241e0844ff79403fa14402b6019a502e149600e5/commonmarkextensions-0.0.5.tar.gz"
}
]
}