tenseleyflow/shithub / 8d41593

Browse files

templates: blob-lines partial — row-per-line table

Authored by espadonne
SHA
8d4159333bba0da80d7de2247099e6bcdfe762f6
Parents
dfe04c4
Tree
a2ae6aa

1 changed file

StatusFile+-
A internal/web/templates/_blob_lines.html 15 0
internal/web/templates/_blob_lines.htmladded
@@ -0,0 +1,15 @@
1
+{{ define "blob-lines" -}}
2
+<div class="shithub-blob-source chroma">
3
+  <table class="shithub-blob-lines">
4
+    <tbody>
5
+      {{ range $i, $line := .Lines }}
6
+      {{ $n := add $i 1 }}
7
+      <tr id="L{{ $n }}">
8
+        <td class="shithub-blob-lnum"><a href="#L{{ $n }}" tabindex="-1">{{ $n }}</a></td>
9
+        <td class="shithub-blob-lcode"><span class="shithub-blob-line">{{ $line }}</span></td>
10
+      </tr>
11
+      {{ end }}
12
+    </tbody>
13
+  </table>
14
+</div>
15
+{{- end }}