<commit_before>.. django-sekizai documentation master file, created by
   sphinx-quickstart on Tue Jun 29 23:12:20 2010.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

##########################################
Welcome to django-sekizai's documentation!
##########################################


.. note::

    If you get an error when using django-sekizai that starts with
    **Invalid block tag:**, please read :ref:`restrictions`.


*****
About
*****

Sekizai means "blocks" in Japanese, and that's what this app provides. A fresh
look at blocks. With django-sekizai you can define placeholders where your
blocks get rendered and at different places in your templates append to those
blocks. This is especially useful for css and javascript. Your sub-templates can
now define css and Javascript files to be included, and the css will be nicely
put at the top and the Javascript to the bottom, just like you should. Also
sekizai will ignore any duplicate content in a single block. 


************
Dependencies
************

* Python 2.6, 2.7, 3.2 or higher.
* Django 1.2.7 or higher.
* django-classy-tags 0.3.1 or higher.


*****
Usage
*****

Configuration
=============

In order to get started with django-sekizai, you'll need to do the following
steps:

* Put 'sekizai' into your ``INSTALLED_APPS`` setting.
* Use one of the following:
    * Put ``sekizai.context_processors.sekizai`` into your
      ``TEMPLATE_CONTEXT_PROCESSORS`` setting and use
      ``django.template.RequestContext`` when rendering your templates.
    * Use ``sekizai.context.SekizaiContext`` when rendering your templates.


Template Tag Reference
======================


.. highlight:: html+django

.. note:: All sekizai template tags require the ``sekizai_tags`` template tag
          library to be loaded.


Handling code snippets
----------------------

.. versionadded:: 0.7
    The ``strip`` flag was added.

Sekizai uses ``render_block`` and ``addtoblock`` to handle unique code snippets.
Define your blocks using ``{% render_block <name> %}`` and add data to that
block using ``{% addtoblock <name> [strip] %}...{% endaddotblock %}``. If the
strip flag is set, leading and trailing whitespace will be removed.

Example Template::

    {% load sekizai_tags %}

    <html>
    <head>
    {% render_block "css" %}
    </head>
    <body>
    Your content comes here.
    Maybe you want to throw in some css:
    {% addtoblock "css" %}
    <link href="/media/css/stylesheet.css" media="screen" rel="stylesheet" type="text/css" /><commit_msg>Fixed typo: endaddotblock => endaddtoblock<commit_after>.. django-sekizai documentation master file, created by
   sphinx-quickstart on Tue Jun 29 23:12:20 2010.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

##########################################
Welcome to django-sekizai's documentation!
##########################################


.. note::

    If you get an error when using django-sekizai that starts with
    **Invalid block tag:**, please read :ref:`restrictions`.


*****
About
*****

Sekizai means "blocks" in Japanese, and that's what this app provides. A fresh
look at blocks. With django-sekizai you can define placeholders where your
blocks get rendered and at different places in your templates append to those
blocks. This is especially useful for css and javascript. Your sub-templates can
now define css and Javascript files to be included, and the css will be nicely
put at the top and the Javascript to the bottom, just like you should. Also
sekizai will ignore any duplicate content in a single block. 


************
Dependencies
************

* Python 2.6, 2.7, 3.2 or higher.
* Django 1.2.7 or higher.
* django-classy-tags 0.3.1 or higher.


*****
Usage
*****

Configuration
=============

In order to get started with django-sekizai, you'll need to do the following
steps:

* Put 'sekizai' into your ``INSTALLED_APPS`` setting.
* Use one of the following:
    * Put ``sekizai.context_processors.sekizai`` into your
      ``TEMPLATE_CONTEXT_PROCESSORS`` setting and use
      ``django.template.RequestContext`` when rendering your templates.
    * Use ``sekizai.context.SekizaiContext`` when rendering your templates.


Template Tag Reference
======================


.. highlight:: html+django

.. note:: All sekizai template tags require the ``sekizai_tags`` template tag
          library to be loaded.


Handling code snippets
----------------------

.. versionadded:: 0.7
    The ``strip`` flag was added.

Sekizai uses ``render_block`` and ``addtoblock`` to handle unique code snippets.
Define your blocks using ``{% render_block <name> %}`` and add data to that
block using ``{% addtoblock <name> [strip] %}...{% endaddtoblock %}``. If the
strip flag is set, leading and trailing whitespace will be removed.

Example Template::

    {% load sekizai_tags %}

    <html>
    <head>
    {% render_block "css" %}
    </head>
    <body>
    Your content comes here.
    Maybe you want to throw in some css:
    {% addtoblock "css" %}
    <link href="/media/css/stylesheet.css" media="screen" rel="stylesheet" type="text/css" />
{'fraction_non_alphanumeric': 0.15497802407796674, 'fraction_numerical': 0.009936938658513281, 'mean_word_length': 3.806244260789715, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5765999', 'n_tokens_mistral': 1557, 'n_tokens_neox': 1439, 'n_words': 611}