Mercurial > dandelion
changeset 495:9b7ec1e97234
syntax-highlight css files
| author | sheep@ghostwheel |
|---|---|
| date | Sat, 11 Oct 2008 12:28:15 +0200 |
| parents | ddaeb6543f62 |
| children | 1744dd3f724d |
| files | dandelion/viewer.py dandelion/wiki.py |
| diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/dandelion/viewer.py Sat Oct 11 11:59:42 2008 +0200 +++ b/dandelion/viewer.py Sat Oct 11 12:28:15 2008 +0200 @@ -44,4 +44,11 @@ content = Markup(u'<img src="%s" class="%s">' % wiki.wiki_image(page.title)) return wiki.template("page.html", page, content=content) +def css_viewer(wiki, page): + if 'syntax' in wiki.macros: + content = wiki.wiki_macro('syntax', page.open().read(), syntax="css") + return wiki.template("page.html", page, content=content) + else: + return text_viewer(wiki, page) + # date=page.date.strftime("%A, %B %d %Y")
