Skip to content

Instantly share code, notes, and snippets.

@colwilson
Created January 12, 2013 12:36
from nagare import presentation
class Welcome(object):
message = "Hello World!"
@presentation.render_for(Welcome)
def render(welcome, h, *args):
"""
HTML fragment is associated with `Welcome` class as its default view.
- `welcome`: an object of type Welcome
- `h`: HTML renderer, it exposes HTML namespace
"""
with h.div:
h << h.span(welcome.message, class_='welcome-class')
return h.root
app = Welcome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment