Metadata-Version: 1.0
Name: cottonmouth
Version: 0.1.3
Summary: Pure-Python HTML generation
Home-page: https://github.com/nosamanuel/cottonmouth
Author: Noah Seger
Author-email: nosamanuel@gmail.com.com
License: Copyright (c) 2013, Noah Seger

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of cottonmouth nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Description: cottonmouth
        ===========
        
        Pure-Python HTML generation, inspired by [Hiccup][1].
        
        ```python
        from cottonmouth.html import render
        from cottonmouth.tags import html, head, body, title, meta, link, h1
        
        def welcome(user=None, **context):
            return ['p', 'Welcome' + (' back!' if user else '!')]
        
        content = (
            # Feel free to use raw HTML
            '<!doctype html>',
            # Tags are represented as sequences with a tag name at the head
            [html,
                # Or just use strings instead of the default tag symbols
                ['head',
                    [title, 'The Site'],
                    # Attributes are passed as a dict immediately after the tag
                    [meta, {'charset': 'utf-8'}],
                    [link, dict(rel='stylesheet', type='text/css',
                                href='static/layout.css')]],
                [body,
                    # You can also call tags as functions with the content as
                    # the first argument and attributes as `kwargs`
                    [header, h1(u'The Website', id='header')],
                    # Use "#id.class" shortcuts to easily create `div` elements
                    ['#map.pretty-map'],
                    # Functions will be called with context and the results rendered
                    ['#main', welcome]]]
        )
        
        render(*content, user=None)
        ```
        
        Equivalent output:
        
        ```html
        <!doctype html>
        <html>
        <head>
          <title>The Site</title>
          <meta content="text/html;charset=utf-8" http-equiv="content-type">
          <link href="static/layout.css" type="text/css" rel="stylesheet">
        </head>
        <body>
          <h1 id="header">Welcome to the site!</h1>
          <div id="map" class="pretty-map"></div>
          <div id="main">
            <p>Welcome!</p>
          </div>
        </body>
        </html>
        ```
        
        
        ### Installation
        
            pip install cottonmouth
        
        
        ### Testing
        
            python setup.py test
        
        
        ### License
        
        BSD Copyright 2013, Noah Seger
        
        
        [1]: https://github.com/weavejester/hiccup
        
Platform: UNKNOWN
