all repos — searchix @ d40c0e188a7fe1b36887f59c4a9958faa81b3d44

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

feat: add detail pages for packages/options

Alan Pearce
commit

d40c0e188a7fe1b36887f59c4a9958faa81b3d44

parent

ef6c98da84c2327e0a0003fb3b1b64a5d1e2d550

1 file changed, 48 insertions(+), 0 deletions(-)

changed files
A frontend/templates/blocks/option.gotmpl
@@ -0,0 +1,48 @@
+{{- define "main" }} + {{- with .Document }} + <h2>{{ .Name }}</h2> + {{ 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> + {{- end }} +{{- end }}