Metadata-Version: 1.0
Name: shrubbery
Version: 0.2
Summary: Simple and smart template engine to generate HTML/XML
Home-page: http://taoetc.org/46
Author: Roberto De Almeida
Author-email: roberto@dealmeida.net
License: MIT
Download-URL: http://cheeseshop.python.org/packages/source/s/shrubbery/shrubbery-0.2.tar.gz
Description: Shrubbery is a *Smart Html Renderer Using Blocks to Bind Expressions Repeatedly*. You can also think of it as the "world's easiest templating engine". Templates hold no logic whatsoever, with nodes being repeated as needed by the replacement data. Here's a simple example::
        
        >>> from shrubbery.template import Template
        >>> template = """
        ... <ul>
        ...     <li>{todo.task}: {todo.description}</li>
        ... </ul>"""
        >>> t = Template(template)
        
        We can pass a single value as the ``todo`` expression::
        
        >>> data = {"todo": {"task": "Work",
        ...                  "description": "Finish article for GRL."}}
        >>> print t.process(data).prettify()
        <ul>
        <li>
        Work: Finish article for GRL.
        </li>
        </ul>
        
        Nothing to see here. Let's pass a list instead, with more tasks::
        
        >>> data = {"todo": [{"task": "Work",
        ...                   "description": "Finish article for GRL."},
        ...                  {"task": "Play",
        ...                   "description": "Finish next version of Shrubbery"}]}
        >>> print t.process(data).prettify()
        <ul>
        <li>
        Work: Finish article for GRL.
        </li>     <li>
        Play: Finish next version of Shrubbery
        </li>
        </ul>
        
        We can even pass a nested list::
        
        >>> data = {"todo": [{"task": "Work",
        ...                   "description": "Finish article for GRL."},
        ...                  {"task": "Play",
        ...                   "description": ["Finish next version of Shrubbery",
        ...                                   "Eat some pretzels"]}]}
        >>> print t.process(data).prettify()
        <ul>
        <li>
        Work: Finish article for GRL.
        </li>     <li>
        Play: Finish next version of Shrubbery
        </li>     <li>
        Play: Eat some pretzels
        </li>
        </ul>
        
        
Keywords: json template html xml
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Text Processing :: Markup
