{ "info": { "author": "Stephane \"Twidi\" Angel", "author_email": "s.angel@twidid.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# django-include-strip-tag\n\nA new \"include_strip\" template tag for Django\n\n## Introduction\n\nThis new templatetag, `include_strip`, works exactly the same as the default `include` template tag provided by Django.\n\nThe only difference is that the `strip` method is applied to the result, to remove leading and trailing spaces.\n\nThe aim is to remove the unwanted space added in text when including a template that just return some text.\n\n\n## Installation\n\n`django-include-strip-tag` is available on Pypi:\n\n```\npip install django-include-strip-tag\n```\n\nOr you can find it on github: https://github.com/twidi/django-include-strip-tag\n\nWhen installed, just add `include_strip_tag` to your `INSTALLED_APPS` in the `settings.py` file of your django project.\n\n\n## Usage\n\nSimply add the tags library in your template, and use `include_strip` instead of `include` when needed:\n\n```django\n{% load include_strip %}\nHello {% include_strip \"user.html %}, how are you today ?\n```\n\n## Why ?\n\nConsidering the \"user.html\" template:\n\n```django\nSomeUserName\n```\n\nIn the previous template (in \"Usage\"), without this new templatetag, the result would be:\n\n```\nHello SomeUSerName , how are you today ?\n```\n\nWith `include_strip`, we have:\n\n```\nHello SomeUSerName, how are you today ?\n```\n\nNotice the difference between the username and the coma... It's because the newline at the end of the included template is kept when the result is added to the parent template.\n\nSo the `include_strip` apply the `strip` method (on the result, which is a string) to remove it.\n\nIt can also help if your included template starts with a line dedicated to load tags libraries :\n\n```django\n{% load somelibrary %}\nadd-something-here\n```\n\nWith the first line having no content rendered, but include a newline, we have this newline in the final template\n\n## License\n\n`django-include-strip-tag` is published under the MIT License (see the LICENSE file)", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/twidi/django-include-strip-tag/downloads", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/twidi/django-include-strip-tag", "keywords": "django include templatetag template strip", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-include-strip-tag", "package_url": "https://pypi.org/project/django-include-strip-tag/", "platform": "any", "project_url": "https://pypi.org/project/django-include-strip-tag/", "project_urls": { "Download": "https://github.com/twidi/django-include-strip-tag/downloads", "Homepage": "https://github.com/twidi/django-include-strip-tag" }, "release_url": "https://pypi.org/project/django-include-strip-tag/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A 'include_strip' templatetag for django to strip trailing and leading spaces/newlines", "version": "0.1.0" }, "last_serial": 744661, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c2a8175e0ece5d736509f7717957f1fe", "sha256": "b2fd04428277f675f7205773e6792f529af0cedb23bcf4fb67f42268147de50a" }, "downloads": -1, "filename": "django-include-strip-tag-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c2a8175e0ece5d736509f7717957f1fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3581, "upload_time": "2012-04-07T19:13:49", "url": "https://files.pythonhosted.org/packages/16/18/2a76285ade12775dfa1584947103f5cd338c17418d319cb2e9d4ddd5d97b/django-include-strip-tag-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c2a8175e0ece5d736509f7717957f1fe", "sha256": "b2fd04428277f675f7205773e6792f529af0cedb23bcf4fb67f42268147de50a" }, "downloads": -1, "filename": "django-include-strip-tag-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c2a8175e0ece5d736509f7717957f1fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3581, "upload_time": "2012-04-07T19:13:49", "url": "https://files.pythonhosted.org/packages/16/18/2a76285ade12775dfa1584947103f5cd338c17418d319cb2e9d4ddd5d97b/django-include-strip-tag-0.1.0.tar.gz" } ] }