Skip to content

@malby /gist:3087622
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
canvas example
from canvas import HtmlCanvas
from bottle import run,route
def render(page):
canvas = HtmlCanvas()
return canvas.render(page)
class BasePage(object):
def render_on(self, canvas):
with canvas.head():
canvas.title(self.title)
with canvas.body():
with canvas.div(id='content'):
self.render_content_on(canvas)
def render_content_on(self, canvas):
pass
class HomePage(BasePage):
title = 'Home'
def render_content_on(self, canvas):
canvas.h1('Welcome')
@route('/')
def index():
return render(HomePage())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.