{ "info": { "author": "Stephane \"Twidi\" Angel", "author_email": "s.angel@twidi.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "|PyPI Version|\n\ndjango-templates-macros\n=======================\n\nAdd macros to your django templates\n\n------\nOrigin\n------\n\nThe original code of this app is taken from https://djangosnippets.org/snippets/2892/ by MattP.\n\nThis snippets cites::\n\n Based on snippet by\n Michal Ludvig http://www.logix.cz/michal\n http://djangosnippets.org/snippets/363/\n\n Extended for args and kwargs into templatetags/kwacro.py by\n Skylar Saveland http://skyl.org\n https://gist.github.com/skyl/1715202\n\n Modified to support rendering into context by matt@peloquin.com\n\n\n-----\nWhere\n-----\n\nYou can find this package here:\n\n- Github repository: https://github.com/twidi/django-templates-macros\n- Pypi package: https://pypi.python.org/pypi/django-templates-macros\n\n\n-----\nUsage\n-----\n\n0) Add this app \"macros\" to your INSTALLED_APPS\n\n1) In your template load the library::\n\n {% load macros %}\n\n2) Define a new macro called 'my_macro' that takes args and/or kwargs\n All will be optional::\n\n {% macro my_macro arg1 arg2 baz=\"Default baz\" %}\n {% firstof arg1 \"default_arg1\" %}\n {% if arg2 %}{{ arg2 }}{% else %}default_arg2{% endif %}\n {{ baz }}\n {% endmacro %}\n\n3) Use the macro with string parameters or context variables::\n\n {% usemacro my_macro \"foo\" \"bar\" baz=\"KW\" %}\n
\n {% usemacro my_macro num_pages \"bar\" %}\n
\n {% setmacro my_macro %} {{ my_macro }}\n\n Renders like::\n\n foo bar KW\n 77 bar Default baz\n default_arg1 default_arg2 Default baz\n\n4) Alternatively save your macros in a separate file, e.g. \"mymacro.html\" and load it to the current template with::\n\n {% loadmacros \"mymacros.html\" %}\n\n Then use these loaded macros in as described above.\n\nBear in mind that defined and loaded macros are local to each template\nfile and are not inherited through `{% extends ... %}` tags.\n\n\n.. |PyPI Version| image:: https://pypip.in/v/django-templates-macros/badge.png\n :target: https://pypi.python.org/pypi/django-templates-macros", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/twidi/django-templates-macros", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-templates-macros", "package_url": "https://pypi.org/project/django-templates-macros/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-templates-macros/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/twidi/django-templates-macros" }, "release_url": "https://pypi.org/project/django-templates-macros/0.2/", "requires_dist": null, "requires_python": null, "summary": "Add macros to your django templates", "version": "0.2" }, "last_serial": 2539910, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "748b708b8a9b800d96599cde39989514", "sha256": "736f5da29f735fdd3dccefde788aedae533574ec16b60e8f219d30ffdd7f98e4" }, "downloads": -1, "filename": "django-templates-macros-0.1.tar.gz", "has_sig": false, "md5_digest": "748b708b8a9b800d96599cde39989514", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4488, "upload_time": "2014-01-27T12:02:43", "url": "https://files.pythonhosted.org/packages/b3/c3/53b4ec32bfdfaf93b5d86bdbf95d2364a92b6e0878daab40613ab82acc76/django-templates-macros-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "8fc6961fec7ce23707f7fed024768214", "sha256": "a810c9e5983bf8cb301166d051f0eacf616582cfdf400cd657f08f5551fdfa89" }, "downloads": -1, "filename": "django_templates_macros-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "8fc6961fec7ce23707f7fed024768214", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6002, "upload_time": "2016-12-26T18:27:59", "url": "https://files.pythonhosted.org/packages/45/0e/9f8f802d3549f6fdfcf667d20e8bd68ba26f6d0b7131a02d31f3b6920311/django_templates_macros-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d6e09caebdac03709ea0f17c0e4017d", "sha256": "add5e41e01be17c56acc470265afefce110bd1e249e36af194ab7481d451ac86" }, "downloads": -1, "filename": "django-templates-macros-0.2.tar.gz", "has_sig": false, "md5_digest": "1d6e09caebdac03709ea0f17c0e4017d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4671, "upload_time": "2016-12-26T18:27:57", "url": "https://files.pythonhosted.org/packages/2d/bb/67e4dfff1d150c88bd185606068225169d148cc2e99dd6ac5a5d0a068e39/django-templates-macros-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8fc6961fec7ce23707f7fed024768214", "sha256": "a810c9e5983bf8cb301166d051f0eacf616582cfdf400cd657f08f5551fdfa89" }, "downloads": -1, "filename": "django_templates_macros-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "8fc6961fec7ce23707f7fed024768214", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6002, "upload_time": "2016-12-26T18:27:59", "url": "https://files.pythonhosted.org/packages/45/0e/9f8f802d3549f6fdfcf667d20e8bd68ba26f6d0b7131a02d31f3b6920311/django_templates_macros-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d6e09caebdac03709ea0f17c0e4017d", "sha256": "add5e41e01be17c56acc470265afefce110bd1e249e36af194ab7481d451ac86" }, "downloads": -1, "filename": "django-templates-macros-0.2.tar.gz", "has_sig": false, "md5_digest": "1d6e09caebdac03709ea0f17c0e4017d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4671, "upload_time": "2016-12-26T18:27:57", "url": "https://files.pythonhosted.org/packages/2d/bb/67e4dfff1d150c88bd185606068225169d148cc2e99dd6ac5a5d0a068e39/django-templates-macros-0.2.tar.gz" } ] }