{
"info": {
"author": "Trent Mick",
"author_email": "trentm@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Topic :: Internet :: WWW/HTTP"
],
"description": "A small Django app that provides template tags for using\n[Markdown](http://daringfireball.net/projects/markdown/) using the\n[python-markdown2](https://github.com/trentm/python-markdown2) library.\n\n# What's with the \"deux\" in the name?\n\nThe obvious name for this project is `django-markdown2`. However, there\n[already is one!](http://github.com/svetlyak40wt/django-markdown2) and name\nconfusion doesn't help anybody. Plus, I took French immersion in school for 12\nyears: might as well put it to use.\n\n# So why another project then?\n\nBecause I wanted to do something slightly different. Django-markdown2's\n`markdown` filter takes\n[\"extras\"](https://github.com/trentm/python-markdown2/wiki/Extras) as arguments\n-- with the one exception that \"safe\" is transformed to python-markdown2's\n`safe_mode` argument. This is handy for quick usage. My use case is more\ncommonly: lots of `markdown` filter and block usage in my Django templates with\nthe same set of python-markdown2 options.\n\n\n# Installation\n\nChoose the *one* of the following that works best for you:\n\n- Install the latest release from PyPI:\n\n pip install django-markdown-deux\n\n or, if you use [ActivePython](http://www.activestate.com/activepython):\n\n pypm install django-markdown-deux\n\n These should install the dependent `python-markdown2` package.\n\n- Get a git clone of the source tree:\n\n git clone git://github.com/trentm/django-markdown-deux.git\n\n You might want a particular tag:\n\n cd django-markdown-deux\n git tag -l # list available tags\n git checkout $tagname\n\n Then you'll need the \"lib\" subdir on your PYTHONPATH:\n\n python setup.py install # or 'export PYTHONPATH=`pwd`/lib:$PYTHONPATH'\n\n You'll also need the [python-markdown2\n library](https://github.com/trentm/python-markdown2):\n\n git clone git@github.com:trentm/python-markdown2.git\n cd python-markdown2\n python setup.py install # or 'export PYTHONPATH=`pwd`/python-markdown2/lib'\n\n\n# Django project setup\n\n1. Add `markdown_deux` to `INSTALLED_APPS` in your project's \"settings.py\".\n\n2. Optionally set some of the `MARKDOWN_DEUX_*` settings. See the \"Settings\"\n section below.\n\n\n# Usage\n\nThe `markdown_deux` facilities typically take an optional \"style\" argument. This\nis a name for a set of options to the `python-markdown2` processor. There is\na \"default\" style that is used if no argument is given. See the\n`MARKDOWN_DEUX_STYLES` setting below for more.\n\n## `markdown` template filter\n\n {% load markdown_deux_tags %}\n ...\n {{ myvar|markdown:\"STYLE\" }} {# convert `myvar` to HTML using the \"STYLE\" style #}\n {{ myvar|markdown }} {# same as `{{ myvar|markdown:\"default\"}}` #}\n\n## `markdown` template block tag\n\n {% load markdown_deux_tags %}\n ...\n {% markdown STYLE %} {# can omit \"STYLE\" to use the \"default\" style #}\n This is some **cool**\n [Markdown](http://daringfireball.net/projects/markdown/)\n text here.\n {% endmarkdown %}\n\n## `markdown_allowed` template tag\n\nIn a template:\n\n {% markdown_allowed %}\n\nwill emit a short HTML blurb that says Markdown syntax is allowed. This can be\nhandy for placing under form elements that accept markdown syntax. You can also\nuse it as the `help_text` for a form field something like:\n\n # myapp/forms.py\n from markdown_deux.templatetags.markdown_deux_tags import markdown_allowed\n class MyForm(forms.Form):\n #...\n description = forms.CharField(\n label=\"Description (required)\",\n widget=forms.Textarea(attrs={\"rows\": 5}),\n help_text=_secondary_span(\"A brief description of your thing.
\"\n + markdown_allowed()),\n required=True)\n\n\n## `markdown_cheatsheet` tag\n\n {% markdown_cheatsheet %}\n\nThis outputs HTML giving a narrow (appropriate for, e.g., a sidebar) listing of\nsome of the more common Markdown features.\n\n\n## `markdown_deux.markdown(TEXT, STYLE)` in your Python code\n\nThe `markdown` filter and block tags above ultimately use this\n`markdown_deux.markdown(...)` function. You might find it useful to do Markdown\nprocessing in your Python code (e.g. in a view, in a model `.save()` method).\n\n\n# Settings\n\nAll settings for this app are optional.\n\n## `MARKDOWN_DEUX_STYLES` setting\n\nA mapping of style name to a dict of keyword arguments for python-markdown2's\n`markdown2.markdown(text, **kwargs)`. For example the default setting is\neffectively:\n\n MARKDOWN_DEUX_STYLES = {\n \"default\": {\n \"extras\": {\n \"code-friendly\": None,\n },\n \"safe_mode\": \"escape\",\n },\n }\n\nI.e. only the \"default\" style is defined and it just uses the [code-friendly\nextra](https://github.com/trentm/python-markdown2/wiki/code-friendly) and escapes\nraw HTML in the given Markdown (for safety).\n\nHere is how you might add styles of your own, and preserve the default style:\n\n # settings.py\n from markdown_deux.conf.settings import MARKDOWN_DEUX_DEFAULT_STYLE\n\n MARKDOWN_DEUX_STYLES = {\n \"default\": MARKDOWN_DEUX_DEFAULT_STYLE,\n \"trusted\": {\n \"extras\": {\n \"code-friendly\": None,\n },\n # Allow raw HTML (WARNING: don't use this for user-generated\n # Markdown for your site!).\n \"safe_mode\": False,\n }\n # Here is what http://code.activestate.com/recipes/ currently uses.\n \"recipe\": {\n \"extras\": {\n \"code-friendly\": None,\n },\n \"safe_mode\": \"escape\",\n \"link_patterns\": [\n # Transform \"Recipe 123\" in a link.\n (re.compile(r\"recipe\\s+#?(\\d+)\\b\", re.I),\n r\"http://code.activestate.com/recipes/\\1/\"),\n ],\n \"extras\": {\n \"code-friendly\": None,\n \"pyshell\": None,\n \"demote-headers\": 3,\n \"link-patterns\": None,\n # `class` attribute put on `pre` tags to enable using\n # for syntax\n # highlighting.\n \"html-classes\": {\"pre\": \"prettyprint\"},\n \"cuddled-lists\": None,\n \"footnotes\": None,\n \"header-ids\": None,\n },\n \"safe_mode\": \"escape\",\n }\n }\n\n\n## `MARKDOWN_DEUX_HELP_URL` setting\n\nA URL for to which to link for full markdown syntax default. This link is\nonly in the output of the `markdown_allowed` and `markdown_cheatsheet`\ntemplate tags.\n\nThe default is , the\ncanonical Markdown syntax reference. However, if your site uses Markdown with\nspecific tweaks, you may prefer to have your own override. For example,\n[ActiveState Code](http://code.activestate.com) uses:\n\n MARKDOWN_DEUX_HELP_URL = \"/help/markdown/\"\n\nTo link to [its own Markdown syntax notes\nURL](http://code.activestate.com/help/markdown/).",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/trentm/django-markdown-deux",
"keywords": "django markdown markdown2 text markup html",
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "django-markdown-deux",
"package_url": "https://pypi.org/project/django-markdown-deux/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-markdown-deux/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://github.com/trentm/django-markdown-deux"
},
"release_url": "https://pypi.org/project/django-markdown-deux/1.0.5/",
"requires_dist": null,
"requires_python": null,
"summary": "a Django app that provides template tags for using Markdown (using the python-markdown2 processor)",
"version": "1.0.5"
},
"last_serial": 1240449,
"releases": {
"1.0.0": [],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "1bf6b9a9248280f3fe6861e4081e75c6",
"sha256": "9db869cdce3b1644e38044e22412bf8ed9463fad343e09765fbf4a6faf08e851"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.1.zip",
"has_sig": false,
"md5_digest": "1bf6b9a9248280f3fe6861e4081e75c6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9173,
"upload_time": "2010-06-15T07:25:30",
"url": "https://files.pythonhosted.org/packages/05/46/63c0f973fe6353b574ce9bc390cf49f090a9cb780b55625358d9a2f46c7a/django-markdown-deux-1.0.1.zip"
}
],
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "4fc0dc3c931e9032c102d82a3c48a392",
"sha256": "6bf2e8451017155c5044b692ce6e3f72939d3d354a27b16c4c6752f5d3d5deab"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.2.zip",
"has_sig": false,
"md5_digest": "4fc0dc3c931e9032c102d82a3c48a392",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15522,
"upload_time": "2010-06-15T07:47:25",
"url": "https://files.pythonhosted.org/packages/4c/52/fd8a6edb99300884b98eb2d9a89e13d8bca1d859e7e313ff63285557be17/django-markdown-deux-1.0.2.zip"
}
],
"1.0.3": [
{
"comment_text": "",
"digests": {
"md5": "a0bf3d219d34b9795c3ef910ad2ca0ae",
"sha256": "ad1734f2a387c8ae066a78e438ace0073bf99c5cac149aebc40cbddd0672c0e5"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.3.zip",
"has_sig": false,
"md5_digest": "a0bf3d219d34b9795c3ef910ad2ca0ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15852,
"upload_time": "2010-06-15T07:56:03",
"url": "https://files.pythonhosted.org/packages/fb/c2/b3fb34408a1e05d92a00103fab560cd199f51c2992ea4393a7ba7fc2c7ad/django-markdown-deux-1.0.3.zip"
}
],
"1.0.4": [
{
"comment_text": "",
"digests": {
"md5": "d1908362261be9f14c3b285a528fa48b",
"sha256": "158e24ac594045bf132500a27cc3c275094a472b91be0e53bf2f6a919314a808"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.4.zip",
"has_sig": false,
"md5_digest": "d1908362261be9f14c3b285a528fa48b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16739,
"upload_time": "2013-03-06T22:47:47",
"url": "https://files.pythonhosted.org/packages/62/4a/589b090b8997af284f00e286232df8ad2382a9233e9e5bf1c3d9afcde4f0/django-markdown-deux-1.0.4.zip"
}
],
"1.0.5": [
{
"comment_text": "",
"digests": {
"md5": "6e3016740f3164020ff93882bc7a6cf0",
"sha256": "5b4a3cd9454af5b4cec0e19151b41d98d09400ddae0688afb81dbf62a4edafff"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.5.zip",
"has_sig": false,
"md5_digest": "6e3016740f3164020ff93882bc7a6cf0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16727,
"upload_time": "2014-09-28T03:28:12",
"url": "https://files.pythonhosted.org/packages/80/a5/d61ee6fc26cbb0d737986ed23e13309c88f2ae7f1fcdf2460a525323a3ed/django-markdown-deux-1.0.5.zip"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "6e3016740f3164020ff93882bc7a6cf0",
"sha256": "5b4a3cd9454af5b4cec0e19151b41d98d09400ddae0688afb81dbf62a4edafff"
},
"downloads": -1,
"filename": "django-markdown-deux-1.0.5.zip",
"has_sig": false,
"md5_digest": "6e3016740f3164020ff93882bc7a6cf0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16727,
"upload_time": "2014-09-28T03:28:12",
"url": "https://files.pythonhosted.org/packages/80/a5/d61ee6fc26cbb0d737986ed23e13309c88f2ae7f1fcdf2460a525323a3ed/django-markdown-deux-1.0.5.zip"
}
]
}