Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timothycrosley/thedom

A python framework to generate html and JavaScript from reusable and combine-able widgets.
https://github.com/timothycrosley/thedom

Last synced: 4 days ago
JSON representation

A python framework to generate html and JavaScript from reusable and combine-able widgets.

Awesome Lists containing this project

README

        

![thedom](https://raw.github.com/timothycrosley/thedom/develop/logo.png)
=====

[![PyPI version](https://badge.fury.io/py/thedom.png)](http://badge.fury.io/py/thedom)
[![PyPi downloads](https://pypip.in/d/thedom/badge.png)](https://crate.io/packages/thedom/)
[![Build Status](https://travis-ci.org/timothycrosley/thedom.png?branch=master)](https://travis-ci.org/timothycrosley/thedom)
[![License](https://pypip.in/license/thedom/badge.png)](https://pypi.python.org/pypi/thedom/)
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/timothycrosley/thedom/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

thedom is a collection of python objects that enable developers to generate and interact with web apps server side.
It encourages object oriented website development, and code reuse by seperating each DOM element into its own object,
and then allowing inheritance and child elements to come together to form new elements not defined in the standard DOM.

write this:

from thedom import layout, document, buttons

page = document.Document()
layout = page.addChildElement(layout.Center()).addChildElement(layout.Horizontal())
layout += buttons.Button(text="Use thedom.", **{'class':'MainAction'})
layout += buttons.Button(text="Enjoy writing less code.", **{'class':'DeleteAction'})
layout += buttons.Button(text="100% Python.")

print page.toHTML(formatted=True)

get this:






















Installing thedom
===================

Installing thedom is as simple as:

pip install thedom

or if you prefer

easy_install thedom

--------------------------------------------

Thanks and I hope you find thedom useful!

~Timothy Crosley