{ "info": { "author": "Noah Seger", "author_email": "nosamanuel@gmail.com.com", "bugtrack_url": null, "classifiers": [], "description": "cottonmouth\n===========\n\nPure-Python HTML generation, inspired by [Hiccup][1].\n\n```python\nfrom cottonmouth.html import render\nfrom cottonmouth.tags import html, head, body, title, meta, link, h1\n\ndef welcome(user=None, **context):\n return ['p', 'Welcome' + (' back!' if user else '!')]\n\ncontent = (\n # Feel free to use raw HTML\n '',\n # Tags are represented as sequences with a tag name at the head\n [html,\n # Or just use strings instead of the default tag symbols\n ['head',\n [title, 'The Site'],\n # Attributes are passed as a dict immediately after the tag\n [meta, {'charset': 'utf-8'}],\n [link, dict(rel='stylesheet', type='text/css',\n href='static/layout.css')]],\n [body,\n # You can also call tags as functions with the content as\n # the first argument and attributes as `kwargs`\n [header, h1(u'The Website', id='header')],\n # Use \"#id.class\" shortcuts to easily create `div` elements\n ['#map.pretty-map'],\n # Functions will be called with context and the results rendered\n ['#main', welcome]]]\n)\n\nrender(*content, user=None)\n```\n\nEquivalent output:\n\n```html\n\n\n
\nWelcome!
\n