all repos — searchix @ 408aed03d3454330120475ca53838a2f4fe28ea3

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: display results in a table, showing details on click

Alan Pearce
commit

408aed03d3454330120475ca53838a2f4fe28ea3

parent

d40c0e188a7fe1b36887f59c4a9958faa81b3d44

1 file changed, 23 insertions(+), 52 deletions(-)

changed files
M frontend/templates/blocks/options.gotmplfrontend/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 }}