$def with (work)
{{excerpt}} {{cond(pages, "From page " + pages + ".", "")}} $if ctx.user: $ctx.user.displayname $_("noted:") "{{comment}}" $else: $:_("An anonymous note:") "{{comment}}"
$for line in excerpt.excerpt.split('\n'): $line $if excerpt.pages: $_("From page") $excerpt.pages. $if excerpt.author: $excerpt.author.displayname $_("noted:") $else: $_("An anonymous note:") "$excerpt.comment"