{ "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