grim/hgkeeper-theme

Implement the file revision template
draft
2020-03-24, Gary Kramlich
37524424f6db
Parents 9ad45fc93a09
Children dc8f79b67b41
Implement the file revision template
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/file/revision.tmpl Tue Mar 24 22:42:17 2020 -0500
@@ -0,0 +1,16 @@
+{header}
+
+<div class="card">
+ <div class="list-group list-group-flush">
+ {changesetheader}
+ {changesetbody}
+ </div>
+</div>
+
+<div class="card mt-2 file">
+ <div class="d-inline-block" style="min-width: 100%">
+ {text%fileline}
+ </div>
+</div>
+
+{footer}
--- a/templates/hgkeeper/map Tue Mar 24 21:21:55 2020 -0500
+++ b/templates/hgkeeper/map Tue Mar 24 22:42:17 2020 -0500
@@ -31,8 +31,6 @@
tagentry = tag/entry.tmpl
-filelog = file/log.tmpl
-
manifest = manifest/list.tmpl
upentry = manifest/upentry.tmpl
direntry = manifest/direntry.tmpl
@@ -54,3 +52,7 @@
difflineplus = diff/lineplus.tmpl
diffstatlink = diff/stat.tmpl
diffstatnolink = diff/stat.tmpl
+
+fileline = '<div class="d-flex"><a href="#{lineid}" class="line-number" data-line-number="{linenumber}"></a><div id="{lineid}" class="line">{strip(line|escape, '\r\n')}</div></div>'
+filelog = file/log.tmpl
+filerevision = file/revision.tmpl
--- a/templates/static/css/hgkeeper.css Tue Mar 24 21:21:55 2020 -0500
+++ b/templates/static/css/hgkeeper.css Tue Mar 24 22:42:17 2020 -0500
@@ -4,7 +4,7 @@
min-width: 12em;
}
-.diff {
+.diff, .file {
font-family: monospace;
overflow-x: auto;
}
@@ -34,6 +34,16 @@
content: attr(data-line-number);
}
+.line {
+ display: inline-block;
+ white-space: pre;
+ flex: 1 1 auto; /* boostrap flex-fill */
+}
+
+.line:target {
+ background-color: #686860;
+}
+
.color-added {
color: #235d23;
}