Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Format with python-creole and tweak the template to fit.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgaughan committed Jul 16, 2012
1 parent a4b6583 commit ac80a95
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
5 changes: 4 additions & 1 deletion examples/notary/notary.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import dbkit
import unicodedata
import re
import creole


urls = (
Expand All @@ -18,7 +19,9 @@
)

app = web.application(urls, globals())
render = web.template.render('templates', base='layout')
render = web.template.render('templates', base='layout', globals={
'creole2html': creole.creole2html
})
pool = dbkit.create_pool(sqlite3, 10, "notary.db")
pool.default_factory = dbkit.dict_set

Expand Down
14 changes: 13 additions & 1 deletion examples/notary/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ html {
a.pnum {
color: #C8A8FF;
text-decoration: none;
font-size: 80%;
font-weight: bold;
display: block;
float: left;
margin-left: -1.5em;
width: 1.5em;
text-align: center;
}

div.note:hover {
background: #FF8;
}
div.note:hover a.pnum {
background: #FF8;
color: #A868FF;
}
14 changes: 6 additions & 8 deletions examples/notary/templates/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

<p><a href="..">Back to projects</a></p>

$if notes:
<ul>
$for note in notes:
<li>$note.note
<a href="#p$note.note_id" name="p$note.note_id" class="pnum">&para;</a>
</li>
</ul>
$else:
$for note in notes:
<div class="note">
<a href="#p$note.note_id" name="p$note.note_id" class="pnum">&para;</a>
$:creole2html(note.note)
</div>
$if not notes:
<p><em>No notes!</em></p>

<form action="" method="post">
Expand Down

0 comments on commit ac80a95

Please sign in to comment.