This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
## [Slim](http://slim-lang.com/) templates syntax for Jinja2.

#### Installation

pip install slimish_jinja

Examples of using it as `Jinja2 extension(jinja_demo.py)`,
with `Flask(flask_demo.py)` and standalone`(convert.py and demo.py)` are bundled.

If you want to use it for any other purpose, the `lexer - lexer.py` and `parser - parser.py` are simple enough.
`lexer` reads the input by lines and generates tokens. `parser` implements a hand rolled recursive descent parser.

For quick reference, this slim::

!5
html
head
/ Inline static content.
title
- block title
|Slimish-Jinja Example
/ Self closing tag with attributes.
meta name="keywords" content="template language"
- assets filters='jsmin', output='gen/packed.js', 'common/jquery.js', 'site/base.js'
%script type="text/javascript" src="{{ ASSET_URL }}"
script
/ Empty jinja tag.
@block script

/ 'id' and 'class' shortcut.
body#home.fluid.liquid
/ Nested static content.
h1
|This is my header.
/ 'div' with 'id' and 'class' shortcut.
#contents.main
/ Empty html tag.
%div
p Dynamic {{ content }}
p
|Nested dyanmic {{ content }}
Left indent is preserved in text blocks.
p
|<a href="http://www.google.com">Google</a>
/ Dynamic attributes.
ul class="{{ user_class }}"
/ Jinja tag.
- for user in users
li {{ user.name }}
- if user.last_name
li {{ user.last_name }}
- elif user.middle_name
li {{ user.middle_name }}
- else
li No user found.

converts to::


<html>
<head>
<title>
{% block title %}
Slimish-Jinja Example
{% endblock %}
</title>
<meta content="template language" name="keywords"/>
<script>
{% block script %}{% endblock %}
</script>
</head>
<body id="home" class="fluid liquid">
<h1>
This is my header.
</h1>
<div id="contents" class="main">
<div></div>
<p>Dynamic {{ content }}</p>
<p>
Nested dyanmic {{ content }} Left indent is preserved in text blocks.
</p>
<p>
<a href="http://www.thoughtnirvana.com">ThoughtNirvana</a>
</p>
</div>
<ul class="{{ user_class }}">
{% for user in users %}
<li>{{ user.name }}</li>
{% if user.last_name %}
<li>{{ user.last_name }}</li>
{% elif user.middle_name %}
<li>{{ user.middle_name }}</li>
{% endif %}
{% else %}
<li>No user found.</li>
{% endfor %}
</ul>
</body>
</html>


#### Doctype delcarations.


!html


!5


!1.1


!strict


!frameset


!mobile


!basic


!transitional



!strict


!frameset


!transitional



#### Static content

/ Inline static content.
h1 This is my header

/ Nested static content.
h1
|This is my header

/ Multiline static content.
p
|Span mutliple lines.
Left indent preserved in the output.


#### Dynamic content

/ Inline
h1 {{ user.title }}

/ Nested
h1
{{ user.title }}

/ Mixed with text.
h1
|The user name is {{ user.name }}


#### Jinja tags

- for user in users
li {{ user.name }}
- if {{ user.lastname }}
li {{ user.lastname }}
- else
li No users found


#### Dynamic contents in attribute

a href="{{ user.url }}" {{ user.name }}


#### **id** and **classname** shortcuts

#contents.main.liquid => <div id="contents" class="main liquid">

body#home.left => <body id="home" class="left">


#### Code comments.

/ Single slash comments.
/ Not part of the output.
p This is content.


#### Empty html tags

%div => <div></div>


#### Empty jinja tags.

@block title => {%block title %}{% endblock %}
Release History

Release History

1.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
slimish_jinja-1.0.2.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Aug 4, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting