{ "info": { "author": "Chris Davis", "author_email": "defbyte@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# Markdown Shortcodes for Django\n\nProvides the ability to use WordPress-like \"shortcodes\" in your content, which get rendered as HTML.\n\nThe idea here is to extend Markdown authoring capabilities. For example, rendering a more complex component in the flow of a content body that shows featured content - or as simple as rendering a full-width Vimeo video.\n\nThis package does not come with a host of shortcodes defined, given these will be highly project-specific.\n\nInstead, it provides a registration system (via a tiny decorator), the shortcode processor, and a template filter for convenience.\n\n## Installation\n\nInstall via pip:\n\n pip install django-markdown-shortcodes\n\nPlease add `markdown_shortcodes` to `INSTALLED_APPS` in your Django project's settings.\n\n\n## Defining Shortcodes\n\nShortcode functions names expected to start with `shortcode_` followed by the string/name that appears in your content.\n\nThe following example creates support for a `[[youtube]]` shortcode.\n\nDefine the processing function, using the `shortcode` decorator to register the function for processing:\n\n from markdown_shortcodes import shortcode\n\n @shortcode\n def shortcode_youtube(*args):\n return render_to_string(\"shortcodes/youtube.html\", {\n 'id': args[0],\n 'title': args[1] if len(args) > 1 else '',\n 'alternate_uri': args[2] if len(args) > 2 else '',\n })\n\nCreate a template file:\n\n
\n
\n \n
\n
\n\nYour content:\n\n So did you know about Whoa McTuggins? I saw an interview with him about preparing tomatos. It changed my life:\n \n [[youtube XTJIGGBN8l4 \"A thrilling exploration of tomato dicing\"]]\n \n Now I prepare pico de gallo almost weekly!\n\n\nAnd in your content's template, something like this (`expand_shortcodes` is a provided by this package):\n\n ...\n {% load shortcodes %}\n \n
\n {{ post.body|expand_shortcodes|safe|your_markdown_filter }}\n
\n \n ...", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/defbyte/django-markdown-shortcodes", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-markdown-shortcodes", "package_url": "https://pypi.org/project/django-markdown-shortcodes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-markdown-shortcodes/", "project_urls": { "Homepage": "https://github.com/defbyte/django-markdown-shortcodes" }, "release_url": "https://pypi.org/project/django-markdown-shortcodes/1.3/", "requires_dist": null, "requires_python": null, "summary": "Utility adding WordPress-like shortcodes for Markdown authoring in Django.", "version": "1.3" }, "last_serial": 1493246, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "bb6074c5223318262d02be65354f5a6c", "sha256": "5f569b49b7293e68663bc2625932564ddb15a32929134c96cd5ac21642ae2c04" }, "downloads": -1, "filename": "django-markdown-shortcodes-1.0.tar.gz", "has_sig": false, "md5_digest": "bb6074c5223318262d02be65354f5a6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2305, "upload_time": "2015-04-06T16:33:05", "url": "https://files.pythonhosted.org/packages/47/93/38a62a935bb13a7d8873ce0ead4e214e66508aa42590b05e8352feccaa9f/django-markdown-shortcodes-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "05239ecd9328c76e471399f1b98dbb83", "sha256": "50e1b9ff6caf113c56c39f3d9ee87b2544aa606abedac3b972a953d0906ec474" }, "downloads": -1, "filename": "django-markdown-shortcodes-1.1.tar.gz", "has_sig": false, "md5_digest": "05239ecd9328c76e471399f1b98dbb83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3737, "upload_time": "2015-04-06T16:53:00", "url": "https://files.pythonhosted.org/packages/ce/59/18a9cb2cfac6e482e30be9722b4bf4572e12c6b69c05ccca21e8952c8d6c/django-markdown-shortcodes-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a026a8e9baa2df02406276bf6db8884c", "sha256": "c6a3550433ed7b37de0244927adbc10d923b20a55a3eaa577a59993bb1ca7710" }, "downloads": -1, "filename": "django-markdown-shortcodes-1.2.tar.gz", "has_sig": false, "md5_digest": "a026a8e9baa2df02406276bf6db8884c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3757, "upload_time": "2015-04-06T16:58:49", "url": "https://files.pythonhosted.org/packages/9e/10/44f876a4f595f7292bd06731f8e25d01225c59470cdc8aad9e6c7056b057/django-markdown-shortcodes-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "2c34a94f8cfd81113a034e54bda2859f", "sha256": "911973c3076fc41fab8fdea9e3031fe20d81314e573d74d0f20a557a9720327e" }, "downloads": -1, "filename": "django-markdown-shortcodes-1.3.tar.gz", "has_sig": false, "md5_digest": "2c34a94f8cfd81113a034e54bda2859f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3762, "upload_time": "2015-04-06T17:05:53", "url": "https://files.pythonhosted.org/packages/22/17/cbd3da56af041e8dbcfc548fe6db1c20936d1d9cf13bf56240ec0dcbdee2/django-markdown-shortcodes-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2c34a94f8cfd81113a034e54bda2859f", "sha256": "911973c3076fc41fab8fdea9e3031fe20d81314e573d74d0f20a557a9720327e" }, "downloads": -1, "filename": "django-markdown-shortcodes-1.3.tar.gz", "has_sig": false, "md5_digest": "2c34a94f8cfd81113a034e54bda2859f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3762, "upload_time": "2015-04-06T17:05:53", "url": "https://files.pythonhosted.org/packages/22/17/cbd3da56af041e8dbcfc548fe6db1c20936d1d9cf13bf56240ec0dcbdee2/django-markdown-shortcodes-1.3.tar.gz" } ] }