{ "info": { "author": "gocept", "author_email": "mail@gocept.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Pre-processors" ], "description": "======================\ngobre.recipe.template\n======================\n\ngobre.recipe.template is a fork of amplecode.recipe.template, a Buildout recipe for generating files using Jinja2 templates. The recipe configures a Jinja2 environment, by default relative to the Buildout directory, allowing templates to extend and include other templates relative to the environment.\n\nDownloads are available from pypi: http://pypi.python.org/pypi/gobre.recipe.template/\n\n.. image:: https://travis-ci.org/gocept/gobre.recipe.template.png\n :target: https://travis-ci.org/gocept/gobre.recipe.template\n\nBuildout Options\n================\n\n* template-file or input (required): One or more Jinja2 template file paths.\n* target-file or output (required): One of more target file paths. The number of files must match the number of template files.\n* base-dir: Base directory of the Jinja2 environment. Template file paths are relative to this directory. Default is the Buildout directory.\n* target-executable: One or more boolean flags (yes|no|true|false|1|0) indicating the executability of the target files. If only one flag is given it is applied to all target files.\n* eggs: Reserved for a list of eggs, conveniently converted into a pkg_resources.WorkingSet when specified\n* jinja2_filters: custom filter functions separated by white-space\n\nAdditional options are simply forwarded to the templates, and options from all the other parts are made available through ``parts..`` and ``parts[][]``.\n\nLists of Values\n===============\n\nIt is possible for a recipe option to contain one or more values, separated by whitespace. A split filter is available for when you want to iterate over the whitespace separated values in your Jinja2 template::\n\n #!/bin/sh\n {% for cmd in cmds|split %}\n echo \"{{ cmd }}\"\n {% endfor %}\n\nMinimal Example\n===============\n\nfoo.txt is created from foo.txt.jinja2 without any extra options::\n\n [buildout]\n parts = foo\n\n [foo]\n recipe = gobre.recipe.template\n template-file = foo.txt.jinja2\n target-file = foo.txt\n\nLarger Example\n==============\n\nfoo.txt is created from myapp/foo.txt.jinja2, bar.sh is created from myapp/bar.sh.jinja2, the second will be executable, and both templates can utilize the additional options specified::\n\n [buildout]\n parts = foo\n\n [foo]\n recipe = gobre.recipe.template\n base-dir = myapp\n template-file =\n foo.txt.jinja2\n bar.sh.jinja2\n input =\n foo.txt\n bar.sh\n output =\n false\n true\n project_name = Another Example\n author = Me\n\n [bar]\n dashed-value = borg\n value = cash\n\nfoo.txt.jinja2:\n::\n\n {{ parts.bar['dashed-value'] }}\n {{ parts.bar.value }}\n {{ author }}\n\n.. note::\n\n `{{ parts.bar.dashed-value }}` won't work, but you can access it as a dict key.\n\nDashed value in the same part\n=============================\n\nIf there is a dashed-value in gobre.recipe.template part and you would like to reference it, use:\n::\n\n {{context['dashed-value']}}\n\n\nCustom filters\n==============\n\nThe filter function is located in the same directory as the buildout.cfg in a filter.py file. If you want to use more filters separate them with a white space. ::\n\n [buildout]\n parts = foo\n\n [foo]\n recipe = gobre.recipe.template\n input = foo.txt.jinja2\n output = foo.txt\n jinja2_filters = filter.bar\n\n\nChangelog\n=========\n\nSee the CHANGELOG file\n\nLicense\n=======\n\nSee the LICENSE file\n\n\nWhy this fork\n=============\n\n* there should be an input and output option in buildout (since the '-' in 'target-file' char is parsed by jinja2)\n* custom filters support\n* templates should not have the ability to change state of buildout\n* Gather the changes of the other forks (buildout 2 support and Python 3 support + fixes into a new package).", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gocept/gobre.recipe.template", "keywords": "zc.buildout recipe template Jinja2", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "gobre.recipe.template", "package_url": "https://pypi.org/project/gobre.recipe.template/", "platform": "", "project_url": "https://pypi.org/project/gobre.recipe.template/", "project_urls": { "Homepage": "https://github.com/gocept/gobre.recipe.template" }, "release_url": "https://pypi.org/project/gobre.recipe.template/1.3/", "requires_dist": null, "requires_python": "", "summary": "Buildout recipe for making files out of Jinja2 templates", "version": "1.3" }, "last_serial": 3089408, "releases": { "1.3": [ { "comment_text": "", "digests": { "md5": "48ba78b7d6c374b3eabd1c0d0a9b030e", "sha256": "a88858e09f448a34e36c9de93d5c5dd89abdf9f8a48bc6f3176f4c92363eabaa" }, "downloads": -1, "filename": "gobre.recipe.template-1.3.tar.gz", "has_sig": false, "md5_digest": "48ba78b7d6c374b3eabd1c0d0a9b030e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7212, "upload_time": "2017-08-11T09:51:51", "url": "https://files.pythonhosted.org/packages/97/ee/cfb4bc24a3bcbe40c384770937736a7f642c9a0d5af31751c2b85cf676f5/gobre.recipe.template-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "48ba78b7d6c374b3eabd1c0d0a9b030e", "sha256": "a88858e09f448a34e36c9de93d5c5dd89abdf9f8a48bc6f3176f4c92363eabaa" }, "downloads": -1, "filename": "gobre.recipe.template-1.3.tar.gz", "has_sig": false, "md5_digest": "48ba78b7d6c374b3eabd1c0d0a9b030e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7212, "upload_time": "2017-08-11T09:51:51", "url": "https://files.pythonhosted.org/packages/97/ee/cfb4bc24a3bcbe40c384770937736a7f642c9a0d5af31751c2b85cf676f5/gobre.recipe.template-1.3.tar.gz" } ] }