From b682ed936d8185e91331e9f66fc0e13072f8b545 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 4 May 2024 15:32:41 +0200 Subject: feat: show metadata in grid --- frontend/static/style.css | 14 ++++++++++ frontend/templates/blocks/options.gotmpl | 45 ++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 11 deletions(-) (limited to 'frontend') diff --git a/frontend/static/style.css b/frontend/static/style.css index 96b7c9b..e72df60 100644 --- a/frontend/static/style.css +++ b/frontend/static/style.css @@ -5,3 +5,17 @@ form { input[type="search"] { width: 100%; } + +dt::after { + content: ": "; +} + +dd { + margin-inline-start: 1rem; +} + +dl { + display: grid; + grid-template-rows: 100%; + grid-template-columns: max-content 1fr; +} diff --git a/frontend/templates/blocks/options.gotmpl b/frontend/templates/blocks/options.gotmpl index 3451eb3..e67a5c1 100644 --- a/frontend/templates/blocks/options.gotmpl +++ b/frontend/templates/blocks/options.gotmpl @@ -1,13 +1,36 @@ {{ define "results" }} - {{ range $opt, $data := .Results }} - - - {{ $opt }} - - - {{ $data.Description }} - - - {{ end }} - + {{- range $opt, $data := .Results }} + + + {{ $opt }} + + + {{ $data.Description }} + + + {{- with $data.Type }} + Type + {{ . }} + {{- end }} + {{- with $data.Default }} + Default + {{ .Text }} + {{- end }} + {{- with $data.Example }} + {{- if .Text }} + Example + {{ .Text }} + {{- end }} + {{- end }} + {{- with $data.Declarations }} + Declared + {{- range . }} + + {{ . }} + + {{- end }} + {{- end }} + + + {{- end }} {{ end }} -- cgit 1.4.1
- {{ $data.Description }} -
+ {{ $data.Description }} +
{{ .Text }}