Django Assess Managed Nicely Documentation



Similar documents
ART 379 Web Design. HTML, XHTML & CSS: Introduction, 1-2

Drupal CMS for marketing sites

Designing for Magento

Setup The package simply needs to be installed and configured for the desired CDN s distribution server.

Hypercosm. Studio.

MyMoney Documentation

HOW TO CREATE THEME IN MAGENTO 2

DEMO ONLY VERSION. Easy CramBible Lab M Magento Front End Developer Certification Exam. ** Single-user License **

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

Version 1.0 OFFICIAL THEME USER GUIDE. reva. HTML5 - Responsive One Page Parallax Theme

Services, Dependency Injection, and Containers, Oh my!

django-cron Documentation

Terms and Definitions for CMS Administrators, Architects, and Developers

Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011

How to start with 3DHOP

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

Installing AWStats on IIS 6.0 (Including IIS 5.1) - Revision 3.0

White Paper Using PHP Site Assistant to create sites for mobile devices

Website Optimization Tips for Speed

Teamstudio USER GUIDE

Creating a new theme. Table of Contents

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Web development... the server side (of the force)

Surround SCM Best Practices

Version 1.3 OFFICIAL THEME USER GUIDE. Renova. Unique Creative Portfolio - Responsive HTML5

Future-proofed SEO for Magento stores

AUDIT REPORT EXAMPLE

WHMCS V4.5 Provisional Changelog

SizmekFeatures. HTML5JSSyncFeature

WebIOPi. Installation Walk-through Macros

Content Management System

requests_toolbelt Documentation

The Django web development framework for the Python-aware

Server-Side Web Development JSP. Today. Web Servers. Static HTML Directives. Actions Comments Tag Libraries Implicit Objects. Apache.

SPELL Tabs Evaluation Version

Improving Magento Front-End Performance

Introduction to XML Applications

Version Control with. Ben Morgan

Portals and Hosted Files

Django Two-Factor Authentication Documentation

Overview Included Files Implementing the Block... 7

Interspire Website Publisher Developer Documentation. Template Customization Guide

CONTACTUS.COM A START GUIDE FOR CREATING YOUR FIRST CONTACT FORM

Web Publisher Administration Guide

EMC Documentum Composer

HOW Interactive Design Conference 2013

Sitecore Dashboard User Guide

Using Dedicated Servers from the game

Grab Your Tablet, Because You re Gonna Build A Mobile Apex App in One Hour!

JTouch Mobile Extension for Joomla! User Guide

Analog Documentation. Release Fabian Büchler

Shipbeat Magento Module. Installation and user guide

Drupal 8 Theming Deep Dive

Evaluation of the CMT and SCRAM Software Configuration, Build and Release Management Tools

WebAmoeba Ticket System Documentation

Creating an newsletter using SimpleNews and phplist

Table of Contents. Overview Supported Platforms Demos/Downloads Known Issues Note Included Files...

GUIDE TO CODE KILLER RESPONSIVE S


SEO Suite Pro. User Guide

An Introduction To The Web File Manager

Setting Up a CLucene and PostgreSQL Federation

X-POS GUIDE. v3.4 INSTALLATION SmartOSC and X-POS

JavaScript Client Guide

EXT:Booking Extension

Configuring Firewalls An XML-based Approach to Modelling and Implementing Firewall Configurations

latest Release 0.2.6

UPK Content Development Rel 11.1

Panda Cloud Protection. Quick guide Service registration procedure

Creating a Guest Book Using WebObjects Builder

Testking.M Q

PrintShop Mail Web. Release Notes

About ZPanel. About the framework. The purpose of this guide. Page 1. Author: Bobby Allen Version: 1.1

Novell Identity Manager

Mastering Magento Theme Design

CrownPeak Playbook CrownPeak Hosting with PHP

Add Feedback Workflow

Advanced Customisation: Scripting EPrints. EPrints Training Course

Kentico 8 Certified Developer Exam Preparation Guide. Kentico 8 Certified Developer Exam Preparation Guide

.NET Best Practices Part 1 Master Pages Setup. Version 2.0

Office Fax

Paul Boisvert. Director Product Management, Magento

monoseq Documentation

Web Development 1 A4 Project Description Web Architecture

EXAM - M Magento Front End Developer. Buy Full Product.

Agile Web Application Testing

Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 9.6)

Web Apps: Using web apps to build amazing functionality without programming. I Love Web Apps. They re Awesome.

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

Transcription:

Django Assess Managed Nicely Documentation Release 0.2.0 Curtis Maloney August 06, 2014

Contents 1 Settings 1 1.1 DAMN_PROCESSORS......................................... 1 1.2 DAMN_MODE_MAP.......................................... 1 1.3 DAMN_MODE_ORDER........................................ 1 2 Template Tags 3 2.1 Assets tag................................................. 3 2.2 Asset tag................................................. 3 3 Processors 5 3.1 ScriptProcessor.............................................. 5 3.2 LinkProcessor.............................................. 5 4 Changelog 7 4.1 v0.2.1................................................... 7 4.2 v0.2.0................................................... 7 4.3 v0.1.1................................................... 7 5 Overview 9 6 Indices and tables 11 i

ii

CHAPTER 1 Settings 1.1 DAMN_PROCESSORS Default: {} A map of Processor configs. Each value is a dict of config values. The only required option is processor, which is an import path for the class to use to process this asset type. DAMN_PROCESSORS = { js : { processor : damn.processors.scriptprocessor, aliases : { jquery : js/vendor/jquery-1.11.min.js, jqplot : js/vendor/jqploy-0.9.min.js, }, deps : { jqplot : [ jquery,], }, }, } See Processors for more details. 1.2 DAMN_MODE_MAP Default: {} A map of file extensions to mode names. In the absense of an entry here, or an explicit mode= attribute on the asset tag, the asset will be assigned to a mode with the same name as its file extension. 1.3 DAMN_MODE_ORDER Default: [ css, js,] A list of the order in which asset types should be rendered. 1

Django Assess Managed Nicely Documentation, Release 0.2.0 2 Chapter 1. Settings

CHAPTER 2 Template Tags 2.1 Assets tag This tag simply marks where to output the asset tags. {% assets %} 2.2 Asset tag Specifies an asset that is required for this page to function. {% asset name...deps... [mode=?] [alias=?] %} The first positional argument is the filename or alias of an asset that is required. Additional positional arguments are names or aliases of assets this asset requires to be included before it. The mode keyword allows you to override which Processor this asset will be assigned to. By default it will be assined to the Processor with the name matching the assets file extension, mapped through DAMN_MODE_MAP 3

Django Assess Managed Nicely Documentation, Release 0.2.0 4 Chapter 2. Template Tags

CHAPTER 3 Processors The processor takes the list of assets and renders the output to the page. As assets are defined in the page, the AssetRegister will assign them to Processors, which it will in turn request to render them. class Processor aliases A map (dict) of aliases to filenames. This is useful for removing the need to, for instance, remember which version of jquery your site is using. deps A map of filenames or aliases to lists of other assets they depend on. Any use of these assets will automatically add the listed dependencies. add_asset(filename, alias, deps) Add an asset to this Processor. This is used by the {% asset %} tag. resolve_deps() Return a list of filenames in an order which respects the declared dependencies. All aliasese will be resolved at this point. alias_map(name) Unalias a given resource name. Out of the box there are two processors: ScriptProcessor, and LinkProcessor. 3.1 ScriptProcessor ScriptProcessor will output each asset in a script tag, after resolving the filename through staticfiles. <script src="{% static filename %}"></script> 3.2 LinkProcessor LinkProcessor will output each asset as a link tag. You can optionally specify in the config the rel and type attributes to be used. 5

Django Assess Managed Nicely Documentation, Release 0.2.0 <link rel="{{ rel }}" type="{{ type }}" href="{% static filename %}"> class LinkProcessor rel Default: stylesheet The value to output for the rel attribute of the link element. type Default: text/css The value to output for the type attribute of the link element. 6 Chapter 3. Processors

CHAPTER 4 Changelog 4.1 v0.2.1 4.1.1 Bugs Fixed Fix forgotten var rename in exception 4.2 v0.2.0 New Features Added more tests Deps can now be new aliases Aliases are implicitly added to Deps Catch dependencies that appear to be missing aliases 4.3 v0.1.1 Initial Release 7

Django Assess Managed Nicely Documentation, Release 0.2.0 8 Chapter 4. Changelog

CHAPTER 5 Overview Yet another approach to handling static assets in your Django project. Django-AMN helps you manage including assets in your templates without requiring contortions to enable adding extra dependencies, only to have duplicates appearing. Simply add the {% assets %} tag where you want your assets listed, and then use the {% asset %} tag to add a requirement. Assets can have dependencies on other assets, so you can be sure they re included, and in the right order. Different asset types [css, js, less, etc] will be assigned to a different Processor, which can handle how they re rendered into the template - including compiling, translating, minifying, etc. Each asset is assigned a mode (by default its file extension) which you can override by specifying it in the tag: {% asset thing/foo.html mode= template %} Assets can have dependencies, so you won t forget to include what s needed. {% asset js/knockout.js js/jquery.js %} You can also pre-define asset dependencies in your settings. To make life easier, any asset can have an alias. Aliases can be assigned in two ways; either in the tag, or in your settings. {% asset js/jquery-1.11.min.js alias= jquery %} Dependencies can refer to aliases, allowing library versions to be updated without breaking your templates. {% asset js/knockout.js jquery %} If you ve configured aliases in your settings, you can use them directly: {% asset jqplot %} 9

Django Assess Managed Nicely Documentation, Release 0.2.0 10 Chapter 5. Overview

CHAPTER 6 Indices and tables genindex modindex search 11