django-template-analyzer

  212 downloads
1.1.0 BSD License    
  not rated
Extract template nodes from a Django template

description

download

specifications

changelog

django-template-analyzer is a Django app that offers an API to analyze the Django template structure. It can be used to find nodes of a particular type, e.g. to do automatic detection of placeholder tags.

API example

from template_analyzer.djangoanalyzer import get_node_instances
from mycms.templatetags.placeholdertags import Placeholder

template = get_template("mycms/default-page.html")

placeholders = get_node_instances(template, Placeholder)
placeholder_names = [p.get_name() for p in placeholders]


Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-template-analyzer

Or the current folder can be installed:

pip install .
READ MORE   
Last updated on May 7th, 2012

0 User reviews so far.

SUBMIT