Lazily render markdown
Getty Ritter
5 years ago
| 85 | 85 |
class design:
|
| 86 | 86 |
@main
|
| 87 | 87 |
def GET(self, id, slug=None):
|
| 88 | |
id = int(id)
|
| 89 | |
design = db.get_design(id)
|
| 88 |
design = db.get_design(int(id))
|
| 90 | 89 |
print(design)
|
| 91 | 90 |
return 'Designs', Templates.design_page(design)
|
| 92 | 91 |
|
| 11 | 11 |
class PageContent:
|
| 12 | 12 |
def __init__(self, source):
|
| 13 | 13 |
self.source = source
|
| 14 | |
self.rendered = markdown.markdown(source)
|
| 14 |
|
| 15 |
def rendered(self):
|
| 16 |
return markdown.markdown(self.source)
|
| 15 | 17 |
|
| 16 | 18 |
class Design(typing.NamedTuple):
|
| 17 | 19 |
title: str
|