dashboard / erock/pico / feat(prose): lists are back bby #102 rss

open · opened on 2026-01-04T04:57:34Z by erock
Help
checkout latest patchset:
ssh pr.pico.sh print pr-102 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print ps-X | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 102
add review to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add --review 102
accept PR:
ssh pr.pico.sh pr accept 102
close PR:
ssh pr.pico.sh pr close 102
Timeline Patchsets

Range-diff rd-186

title
feat(prose): lists are back bby
description
Patch changed
old #1
e265f5e
new #1
ff673f6
Back to top
1: e265f5e ! 1: ff673f6 feat(prose): lists are back bby

old

new:pkg/apps/prose/html/list.partial.tmpl
+{{define "list"}}
+{{$indent := 0}}
+{{$mod := 0}}
+<ul style="list-style-type: {{.ListType}};">
+    {{range .Items}}
+        {{if lt $indent .Indent}}
+        <ul style="list-style-type: {{$.ListType}};">
+        {{else if gt $indent .Indent}}
+
+        {{$mod = minus $indent .Indent}}
+        {{range $y := intRange 1 $mod}}
+        </li></ul>
+        {{end}}
+
+        {{else}}
+        </li>
+        {{end}}
+        {{$indent = .Indent}}
+
+        {{if .IsText}}
+            {{if .Value}}
+            <li>{{.Value}}
+            {{end}}
+        {{end}}
+
+        {{if .IsURL}}
+        <li><a href="{{.URL}}">{{.Value}}</a>
+        {{end}}
+
+        {{if .IsImg}}
+        <li><img src="{{.URL}}" alt="{{.Value}}" />
+        {{end}}
+
+        {{if .IsBlock}}
+        <li><blockquote>{{.Value}}</blockquote>
+        {{end}}
+
+        {{if .IsHeaderOne}}
+        </ul><h2 class="text-xl font-bold">{{.Value}}</h2><ul style="list-style-type: {{$.ListType}};">
+        {{end}}
+
+        {{if .IsHeaderTwo}}
+        </ul><h3 class="text-lg font-bold">{{.Value}}</h3><ul style="list-style-type: {{$.ListType}};">
+        {{end}}
+
+        {{if .IsPre}}
+        <li><pre>{{.Value}}</pre>
+        {{end}}
+    {{end}}
+</ul>
+{{end}}

new

new:pkg/apps/prose/html/list.partial.tmpl
+{{define "list"}}
+{{$indent := 0}}
+{{$mod := 0}}
+<ul style="list-style-type: {{.ListType}};">
+    {{range .Items}}
+        {{if lt $indent .Indent}}
+        <ul>
+        {{else if gt $indent .Indent}}
+
+        {{$mod = minus $indent .Indent}}
+        {{range $y := intRange 1 $mod}}
+        </li></ul>
+        {{end}}
+
+        {{else}}
+        </li>
+        {{end}}
+        {{$indent = .Indent}}
+
+        {{if .IsText}}
+            {{if .Value}}
+            <li>{{.Value}}
+            {{end}}
+        {{end}}
+
+        {{if .IsURL}}
+        <li><a href="{{.URL}}">{{.Value}}</a>
+        {{end}}
+
+        {{if .IsImg}}
+        <li><img src="{{.URL}}" alt="{{.Value}}" />
+        {{end}}
+
+        {{if .IsBlock}}
+        <li><blockquote>{{.Value}}</blockquote>
+        {{end}}
+
+        {{if .IsHeaderOne}}
+        </ul><h2 class="text-xl font-bold">{{.Value}}</h2><ul style="list-style-type: {{$.ListType}};">
+        {{end}}
+
+        {{if .IsHeaderTwo}}
+        </ul><h3 class="text-lg font-bold">{{.Value}}</h3><ul style="list-style-type: {{$.ListType}};">
+        {{end}}
+
+        {{if .IsPre}}
+        <li><pre>{{.Value}}</pre>
+        {{end}}
+    {{end}}
+</ul>
+{{end}}