my eye

commit.html

$def with (project, repo, commit_id)
$ commit = repo.log()[commit_id]
$ title, _, description = commit["message"].partition("\n\n")
$ ts = commit["timestamp"]
$ short_hash = commit_id[:6]
$ breadcrumbs = ("projects", "Projects", project, (None, ["u-ragt.ag-change-of"],
$                f"<b>{project}</b>"), "commits", "Commits")

$var breadcrumbs = breadcrumbs
$var title: $:str(mkdn(title))[3:-4]
$var title_classes = ["p-name"]
$var classes = ["h-entry"]

<link rel=stylesheet href=$tx.origin/static/solarized.css media=screen>
<style>
div.highlight {
  font-size: .75em; }
.linenodiv .normal {
  display: none; }
</style>

<p style=font-size:.75em>Committed <time class=dt-published datetime=$ts.isoformat()>$ts.diff_for_humans()</time>
<a class=p-ragt.ag-change-id href=/projects/$project/commits/$short_hash>$short_hash</a></p>
$if description:
    <p class=p-content>$:mkdn(description)</p>
$for file in colorize_diff("\n".join(repo.show(commit_id))):
    <h3><span style=color:#dc322f>$file["from"]</span><br>
    <span style=color:#859900>$file["to"]</span></h3>
    $for changed_linenos, changed_lines in file["changes"]:
        $changed_linenos<br>
        $:highlight(changed_lines, "a.py", diff=changed_linenos)