Skip to main content

django-pipeline compiler for eco templates

Project description

django-pipeline-eco is a compiler for django-pipeline.

This compiler will produce a JS using the widely used JST model.

It basically compiles and appends to the window.JST JSON array the template that you request (through django-pipeline) using for example Backbone.js or Spine.js .

Installation

pip install django-pipeline-eco

Add these lines in your django settings.py:

PIPELINE_JS = {
    'application': {
        'source_filenames': (
            # Your other JS files...
            'path/to/your/templates/*.eco',
        ),
        'output_filename': 'js/application.js'
    }
}

PIPELINE_COMPILERS = (
    'pipeline_eco.compiler.EcoCompiler',
)

Usage

If the paths are set correctly (try to play a bit depending on your static files situation), the eco will be compiled in a JS file and included automatically by pipeline.

You will just need then to call the rendered template using

Example.Views.Test = Backbone.View.extend
        template: "templates/example",

        render: (done) ->
                @el.innerHTML = JST[@template]

Deeply inspired by

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-pipeline-eco-0.1.5.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file django-pipeline-eco-0.1.5.tar.gz.

File metadata

File hashes

Hashes for django-pipeline-eco-0.1.5.tar.gz
Algorithm Hash digest
SHA256 840fbf92fb2509af4583179a53c7d120101e419c7e774d47c291355ba894f13c
MD5 921e0e6a39abb70c2b2e030d19008b68
BLAKE2b-256 99a1a49a54aee97b868c28e0cedc6b5b5058c98ccd5a8d801cf721c87f8a4bc1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page