{ "info": { "author": "Rahul Kumar", "author_email": "rahul@thoughtnirvana.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "## [Slim](http://slim-lang.com/) templates syntax for Jinja2. \n\nThis release breaks compatibility. Parsing = for Jinja Output is complex. I dropped it in favor of directly using `{{ jinja_output }}`.\n\nThis release(1.0) onwards, the backward syntax compatibility will be maintained.\n\n#### Installation\n\n pip install slimish_jinja\n\nExamples of using it as `Jinja2 extension(jinja_demo.py)`,\nwith `Flask(flask_demo.py)` and standalone`(convert.py and demo.py)` are bundled.\n\nIf you want to use it for any other purpose, the `lexer - lexer.py` and `parser - parser.py` are simple enough.\n`lexer` reads the input by lines and generates tokens. `parser` implements a hand rolled recursive descent parser.\n\nFor quick reference, this slim::\n\n !5\n html\n head\n / Inline static content.\n title\n - block title\n |Slimish-Jinja Example\n / Self closing tag with attributes.\n meta name=\"keywords\" content=\"template language\"\n %script type=\"text/javascript\" src=\"{{ ASSET_URL }}\"\n script\n / Empty jinja tag.\n @block script\n\n / 'id' and 'class' shortcut.\n body#home.fluid.liquid\n / Nested static content.\n h1\n |This is my header.\n / 'div' with 'id' and 'class' shortcut.\n #contents.main\n / Empty html tag.\n %div\n p Dynamic {{ content }}\n p\n |Nested dyanmic {{ content }}\n Left indent is preserved in text blocks.\n p\n |Google\n / Dynamic attributes.\n ul class=\"{{ user_class }}\"\n / Jinja tag.\n - for user in users\n li {{ user.name }}\n - if user.last_name\n li {{ user.last_name }}\n - elif user.middle_name\n li {{ user.middle_name }}\n - else\n li No user found.\n\nconverts to::\n\n \n \n
\nDynamic {{ content }}
\n\n Nested dyanmic {{ content }} Left indent is preserved in text blocks.\n
\n\n ThoughtNirvana\n
\n