{ "info": { "author": "Diederik van der Boor", "author_email": "opensource@edoburu.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-capture-tag\n==================\n\n.. image:: https://img.shields.io/travis/edoburu/django-capture-tag/master.svg?branch=master\n :target: http://travis-ci.org/edoburu/django-capture-tag\n.. image:: https://img.shields.io/pypi/v/django-capture-tag.svg\n :target: https://pypi.python.org/pypi/django-capture-tag/\n.. image:: https://img.shields.io/pypi/dm/django-capture-tag.svg\n :target: https://pypi.python.org/pypi/django-capture-tag/\n.. image:: https://img.shields.io/badge/wheel-yes-green.svg\n :target: https://pypi.python.org/pypi/django-capture-tag/\n.. image:: https://img.shields.io/pypi/l/django-capture-tag.svg\n :target: https://pypi.python.org/pypi/django-capture-tag/\n.. image:: https://img.shields.io/codecov/c/github/edoburu/django-capture-tag/master.svg\n :target: https://codecov.io/github/edoburu/django-capture-tag?branch=master\n\nA micro-library to capture output in Django templates.\n\nThis can be useful for example to:\n\n* Repeat page titles in web pages, e.g. for the ```` tag and breadcrumb.\n* Repeat contents for Social Media tags.\n* Reusing thumbnail output in multiple places.\n* Fetch configuration data from extended templates.\n\n\nInstallation\n------------\n\nInstall the module from PyPI:\n\n.. code-block:: bash\n\n pip install django-capture-tag\n\nAdd the package to ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n INSTALLED_APPS += (\n 'capture_tag',\n )\n\nLoad the tag in your template:\n\n.. code-block:: html+django\n\n {% load capture_tags %}\n\n\nSyntax\n------\n\nThe following options are available:\n\n.. code-block:: html+django\n\n {% capture %}...{% endcapture %} # output in {{ capture }}\n {% capture silent %}...{% endcapture %} # output in {{ capture }} only\n {% capture as varname %}...{% endcapture %} # output in {{ varname }}\n {% capture as varname silent %}...{% endcapture %} # output in {{ varname }} only\n\n\nExample usage\n-------------\n\nTo capture Social Media tags:\n\n.. code-block:: html+django\n\n {% load capture_tags %}\n\n <head>\n ...\n\n {# Allow templates to override the page title/description #}\n <meta name=\"description\" content=\"{% capture as meta_description %}{% block meta-description %}{% endblock %}{% endcapture %}\" />\n <title>{% capture as meta_title %}{% block meta-title %}Untitled{% endblock %}{% endcapture %}\n\n {# display the same value as default, but allow templates to override it. #}\n \n \n \n\nTake configuration from extended templates:\n\n.. code-block:: html+django\n\n # base.html\n\n {% load capture_tags %}\n\n # read once\n {% capture as home_url silent %}{% block home_url %}{% url 'app:index' %}{% endblock %}{% endcapture %}\n\n # reuse twice.\n Back to home\n Back to home\n\n # child.html\n {% extends \"base.html\" %}\n\n {% block home_url %}{% url 'user:profile' %}{% endblock %}\n\nNotice\n~~~~~~\n\nWhen a value is used only once, this package is not needed.\nIn such case, simply place the ``{% block .. %}`` at the proper location where contents is replaced.\nAll common Django template tags support the ``as variable`` syntax,\nsuch as ``{% url 'app:index' as home_url %}`` or ``{% trans \"Foo\" as foo_label %}``.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/edoburu/django-capture-tag/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/edoburu/django-capture-tag", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "django-capture-tag", "package_url": "https://pypi.org/project/django-capture-tag/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-capture-tag/", "project_urls": { "Download": "https://github.com/edoburu/django-capture-tag/zipball/master", "Homepage": "https://github.com/edoburu/django-capture-tag" }, "release_url": "https://pypi.org/project/django-capture-tag/1.0/", "requires_dist": null, "requires_python": "", "summary": "A micro-library to capture output in Django templates", "version": "1.0" }, "last_serial": 2074033, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9ff7dfc3c0b118c403e89172eaf5dc7c", "sha256": "a996f64996830c00641b5b41503c62616f9613a478c84a303fc414e96bfb4891" }, "downloads": -1, "filename": "django_capture_tag-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9ff7dfc3c0b118c403e89172eaf5dc7c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6710, "upload_time": "2016-04-20T12:52:33", "url": "https://files.pythonhosted.org/packages/62/6f/c00e3e52de91debfb09c1d197da0d229143047d4f2d81f9f1a6272d2b8f8/django_capture_tag-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65dca00427c4ed06f25cf5b879ed55ed", "sha256": "9c8a531687aac2a705a16a96c33930fb8193c17b641b7c24cd97ff180053d539" }, "downloads": -1, "filename": "django-capture-tag-1.0.tar.gz", "has_sig": false, "md5_digest": "65dca00427c4ed06f25cf5b879ed55ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8405, "upload_time": "2016-04-20T12:52:40", "url": "https://files.pythonhosted.org/packages/ef/88/0f8125b5d48c498b2009e472842628a458648b167ba1bdbdf09eb1d5937c/django-capture-tag-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ff7dfc3c0b118c403e89172eaf5dc7c", "sha256": "a996f64996830c00641b5b41503c62616f9613a478c84a303fc414e96bfb4891" }, "downloads": -1, "filename": "django_capture_tag-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9ff7dfc3c0b118c403e89172eaf5dc7c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6710, "upload_time": "2016-04-20T12:52:33", "url": "https://files.pythonhosted.org/packages/62/6f/c00e3e52de91debfb09c1d197da0d229143047d4f2d81f9f1a6272d2b8f8/django_capture_tag-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65dca00427c4ed06f25cf5b879ed55ed", "sha256": "9c8a531687aac2a705a16a96c33930fb8193c17b641b7c24cd97ff180053d539" }, "downloads": -1, "filename": "django-capture-tag-1.0.tar.gz", "has_sig": false, "md5_digest": "65dca00427c4ed06f25cf5b879ed55ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8405, "upload_time": "2016-04-20T12:52:40", "url": "https://files.pythonhosted.org/packages/ef/88/0f8125b5d48c498b2009e472842628a458648b167ba1bdbdf09eb1d5937c/django-capture-tag-1.0.tar.gz" } ] }