{ "info": { "author": "Syrus Akbary", "author_email": "me@syrusakbary.com", "bugtrack_url": null, "classifiers": [], "description": "======\nPyJade\n======\n\nPyJade is a high performance port of Jade-lang for python, that converts any .jade source to the each Template-language (Django, Jinja2, Mako or Tornado).\n\n\nUTILITIES\n=========\nTo simply output the conversion to your console::\n\n pyjade [-c django|jinja|mako|tornado] input.jade [output.html]\n\n\nINSTALLATION\n============\n\nFirst, you must do::\n\n pip install pyjade\n\nOr::\n\n python setup.py install\n\nNow simply **name your templates with a `.jade` extension** and this jade compiler\nwill do the rest. Any templates with other extensions will not be compiled\nwith the pyjade compiler.\n\n\nDjango\n------\n\nIn `settings.py`, add a `loader` to `TEMPLATES` like so:\n\n.. code:: python\n\n TEMPLATES = [\n {\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\n 'DIRS': [],\n 'OPTIONS': {\n 'context_processors': [\n 'django.template.context_processors.debug',\n 'django.template.context_processors.request',\n 'django.contrib.auth.context_processors.auth',\n 'django.contrib.messages.context_processors.messages',\n 'django.core.context_processors.request'\n ],\n 'loaders': [\n # PyJade part: ##############################\n ('pyjade.ext.django.Loader', (\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n ))\n ],\n 'builtins': ['pyjade.ext.django.templatetags'], # Remove this line for Django 1.8\n },\n },\n ]\n\n\nJinja2\n------\n\nJust add `pyjade.ext.jinja.PyJadeExtension` as extension\n\n.. code:: python\n\n jinja_env = Environment(extensions=['pyjade.ext.jinja.PyJadeExtension'])\n\n\nMako\n----\n\nJust add `pyjade.ext.mako.preprocessor` as preprocessor\n\n.. code:: python\n\n from pyjade.ext.mako import preprocessor as mako_preprocessor\n mako.template.Template(haml_source,\n preprocessor=mako_preprocessor\n )\n\n\nFlask\n-----\n\nJust add `pyjade.ext.jinja.PyJadeExtension` as extension to the environment of the app\n\n.. code:: python\n\n app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')\n\n\nPyramid\n-------\n\nAdjust your \"your_project/__init__.py\" and add the following line somewhere to in the main() function\n\n.. code:: python\n\n config.include('pyjade.ext.pyramid')\n\n\nTornado Templates\n-----------------\n\nAppend this after importing tornado.template\n\n.. code:: python\n\n from tornado import template\n from pyjade.ext.tornado import patch_tornado\n patch_tornado()\n\n (...)\n\n\nSyntax\n======\n\nExactly the same as the Jade Node.js module (except of cases, which are not implemented)\nhttps://github.com/visionmedia/jade/blob/master/README.md\n\n\nExample\n-------\n\nThis code\n\n.. code:: jade\n\n !!! 5\n html(lang=\"en\")\n head\n title= pageTitle\n script(type='text/javascript')\n if (foo) {\n bar()\n }\n body\n h1.title Jade - node template engine\n #container\n if youAreUsingJade\n p You are amazing\n else\n p Get on it!\n\n\nConverts to\n\n.. code:: html\n\n \n \n \n {{pageTitle}}\n \n \n \n

Jade - node template engine

\n
\n {%if youAreUsingJade%}\n

You are amazing

\n {%else%}\n

Get on it!

\n {%endif%}\n
\n \n \n\n\nRegister filters\n================\n\nIf you want to register a function as a filter, you only have to\ndecorate the function with ``pyjade.register_filter(\"filter_name\")``\n\n.. code:: python\n\n import pyjade\n\n @pyjade.register_filter('capitalize')\n def capitalize(text,ast):\n return text.capitalize()\n\n\nTESTING\n=======\n\nYou must have `nose` package installed.\nYou can do the tests with::\n \n ./test.sh\n\n\nTODOs and BUGS\n==============\nSee: http://github.com/syrusakbary/pyjade/issues", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/syrusakbary/pyjade", "keywords": "jade template converter", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "axado.pyjade", "package_url": "https://pypi.org/project/axado.pyjade/", "platform": "", "project_url": "https://pypi.org/project/axado.pyjade/", "project_urls": { "Homepage": "http://github.com/syrusakbary/pyjade" }, "release_url": "https://pypi.org/project/axado.pyjade/5.0.0/", "requires_dist": null, "requires_python": "", "summary": "Jade syntax template adapter for Django, Jinja2, Mako and Tornado templates", "version": "5.0.0" }, "last_serial": 3429189, "releases": { "4.0.0": [ { "comment_text": "", "digests": { "md5": "8c349324670000008a75db631c00b7e5", "sha256": "2baca386dac62030c9ea155a135094351cf9a3b6f2d0a1730176f3cb42319331" }, "downloads": -1, "filename": "axado.pyjade-4.0.0.tar.gz", "has_sig": false, "md5_digest": "8c349324670000008a75db631c00b7e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43514, "upload_time": "2017-09-18T19:02:44", "url": "https://files.pythonhosted.org/packages/2c/f8/a2e79b67863593152a63a9405bd0fb3f24ba0a5850546ae8d7c7b0f94c7f/axado.pyjade-4.0.0.tar.gz" } ], "4.0.3": [ { "comment_text": "", "digests": { "md5": "350a5843ba300200fa7542e48adc720c", "sha256": "c3bd1eb4788eae2c3789db470beb3f2e9f1979cb43bcf7071096c489c8195e38" }, "downloads": -1, "filename": "axado.pyjade-4.0.3.tar.gz", "has_sig": false, "md5_digest": "350a5843ba300200fa7542e48adc720c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43517, "upload_time": "2017-09-19T10:42:59", "url": "https://files.pythonhosted.org/packages/2c/44/ff439fda04cf7dbbf2c7c6b2a149e26e87391f9e3cd5e00ff8f36cb4ce50/axado.pyjade-4.0.3.tar.gz" } ], "4.0.4": [ { "comment_text": "", "digests": { "md5": "648584e1fe3f65f3f3a404414b9acd28", "sha256": "5c85c9beb11a4ece8784fcc841b10c5ca02ef471424e250fba1cd413c2c0efb9" }, "downloads": -1, "filename": "axado.pyjade-4.0.4.tar.gz", "has_sig": false, "md5_digest": "648584e1fe3f65f3f3a404414b9acd28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47127, "upload_time": "2017-09-20T17:15:51", "url": "https://files.pythonhosted.org/packages/a3/74/9e4bcf1f53b4a79bb308756133d28038887111604c6e39ee0626517542ad/axado.pyjade-4.0.4.tar.gz" } ], "5.0.0": [ { "comment_text": "", "digests": { "md5": "c4c2e164e5481c1e00550da5f13a7b2f", "sha256": "787b4ec21c4e1dd3404441025f3090b2dadea581bf6725fa068a086eb67c293e" }, "downloads": -1, "filename": "axado.pyjade-5.0.0.tar.gz", "has_sig": false, "md5_digest": "c4c2e164e5481c1e00550da5f13a7b2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 45104, "upload_time": "2017-12-19T19:20:10", "url": "https://files.pythonhosted.org/packages/bd/dd/fd51bd2151fc84ba79a3b03f3cf36395eb92d3082345dd5f1a4a879387a2/axado.pyjade-5.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4c2e164e5481c1e00550da5f13a7b2f", "sha256": "787b4ec21c4e1dd3404441025f3090b2dadea581bf6725fa068a086eb67c293e" }, "downloads": -1, "filename": "axado.pyjade-5.0.0.tar.gz", "has_sig": false, "md5_digest": "c4c2e164e5481c1e00550da5f13a7b2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 45104, "upload_time": "2017-12-19T19:20:10", "url": "https://files.pythonhosted.org/packages/bd/dd/fd51bd2151fc84ba79a3b03f3cf36395eb92d3082345dd5f1a4a879387a2/axado.pyjade-5.0.0.tar.gz" } ] }