about summary refs log tree commit diff stats
path: root/frontend/templates/blocks/options.gotmpl
diff options
context:
space:
mode:
authorAlan Pearce2024-06-08 20:34:37 +0200
committerAlan Pearce2024-06-08 20:42:48 +0200
commit408aed03d3454330120475ca53838a2f4fe28ea3 (patch)
tree78d0bb27634154a4ac956c851ea12b71db9ac6b9 /frontend/templates/blocks/options.gotmpl
parentd40c0e188a7fe1b36887f59c4a9958faa81b3d44 (diff)
downloadsearchix-408aed03d3454330120475ca53838a2f4fe28ea3.tar.lz
searchix-408aed03d3454330120475ca53838a2f4fe28ea3.tar.zst
searchix-408aed03d3454330120475ca53838a2f4fe28ea3.zip
feat: display results in a table, showing details on click
Diffstat (limited to 'frontend/templates/blocks/options.gotmpl')
-rw-r--r--frontend/templates/blocks/options.gotmpl75
1 files changed, 23 insertions, 52 deletions
diff --git a/frontend/templates/blocks/options.gotmpl b/frontend/templates/blocks/options.gotmpl
index de31696..5a08bae 100644
--- a/frontend/templates/blocks/options.gotmpl
+++ b/frontend/templates/blocks/options.gotmpl
@@ -1,54 +1,25 @@
 {{- define "hits" }}
-  {{- range . }}
-    {{- with .Data }}
-      <details id="{{ .Name }}">
-        <summary>
-          <h3>{{ .Name }}</h3>
-        </summary>
-        {{ markdown .Description }}
-        <dl>
-          {{- with .Type }}
-            <dt>Type</dt>
-            <dd><code>{{ . }}</code></dd>
-          {{- end }}
-          {{- with .Default }}
-            {{- if or .Text .Markdown }}
-              <dt>Default</dt>
-              <dd>
-                {{- if .Markdown }}
-                  {{ markdown .Markdown }}
-                {{- else }}
-                  <pre><code>{{ .Text }}</code></pre>
-                {{- end }}
-              </dd>
-            {{- end }}
-          {{- end }}
-          {{- with .Example }}
-            {{- if or .Text .Markdown }}
-              <dt>Example</dt>
-              <dd>
-                {{- if .Markdown }}
-                  {{ markdown .Markdown }}
-                {{- else }}
-                  <pre><code>{{ .Text }}</code></pre>
-                {{- end }}
-              </dd>
-            {{- end }}
-          {{- end }}
-          {{- with .RelatedPackages }}
-            <dt>Related Packages</dt>
-            <dd>{{ . }}</dd>
-          {{- end }}
-          {{- with .Declarations }}
-            <dt>Declared</dt>
-            {{- range . }}
-              <dd>
-                <a href="{{ .URL }}">{{ .Name }}</a>
-              </dd>
-            {{- end }}
-          {{- end }}
-        </dl>
-      </details>
-    {{- end }}
-  {{- end }}
+  <table>
+    <thead>
+      <tr>
+        <th scope="col">Title</th>
+        <th scope="col">Description</th>
+      </tr>
+    </thead>
+    <tbody>
+      {{- range . }}
+        {{- with .Data }}
+          <tr>
+            <td>
+              <a href="{{ .Name }}" class="open-dialog">{{ .Name }}</a>
+            </td>
+            <td>
+              {{ markdown (firstSentence .Description) }}
+              <dialog id="{{ .Name }}"></dialog>
+            </td>
+          </tr>
+        {{- end }}
+      {{- end }}
+    </tbody>
+  </table>
 {{- end }}