Created
January 12, 2013 12:36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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