Template tags
=============

To make working with KSS easier the kss.django package provides you
with a set of template tags. These can be found under the `kss` id.

  >>> from django.template import Context, Template
  >>> t = Template("{% load ksstags %} Loaded")
  >>> c = Context()
  >>> t.render(c)
  u' Loaded'


KSS Javascript
==============

Writing include statements for script tags can be a bit tedious. The
`kss_javascript` tag makes sure a script tag is created with the url
pointing to the KSS Javascript view.

  >>> t = Template("{% load ksstags %}{% kss_js %}")
  >>> c = Context()
  >>> t.render(c)
  u'<script type="text/javascript" src="/kss/kss.js"></script>'


Extra Javascripts
=================

If writing a single script tag is tedious than creating multiple is
even worse. To alleviate this pain a tag is included to create all the
script tags needed for each and every plugin that is activated.

  >>> t = Template("{% load ksstags %}{% kss_extra_scripts %}")
  >>> c = Context()
  >>> print t.render(c)
  <script type="text/javascript" src="/kss/base2-dom-fp.js"></script>
  <script type="text/javascript" src="/kss/sarissa.js"></script>


KSS Base URL
============

If you call a server action without an absolute url KSS will append it
to the KSS base URL. This is generated as a link element in the HTML
page using the `kss_base_url` tag. This reads `KSS_BASE_URL` from your
settings file.

  >>> t = Template("{% load ksstags %}{% kss_base_url %}")
  >>> c = Context()
  >>> print t.render(c)
  <link rel="kss-base-url" href="http://localhost:8000/ajax/" />
