From d40c0e188a7fe1b36887f59c4a9958faa81b3d44 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 8 Jun 2024 20:31:47 +0200
Subject: feat: add detail pages for packages/options
---
frontend/static/style.css | 4 --
frontend/templates/blocks/option.gotmpl | 48 ++++++++++++++++++++++
frontend/templates/blocks/package.gotmpl | 69 ++++++++++++++++++++++++++++++++
3 files changed, 117 insertions(+), 4 deletions(-)
create mode 100644 frontend/templates/blocks/option.gotmpl
create mode 100644 frontend/templates/blocks/package.gotmpl
(limited to 'frontend')
diff --git a/frontend/static/style.css b/frontend/static/style.css
index ff4cc6e..8d5977f 100644
--- a/frontend/static/style.css
+++ b/frontend/static/style.css
@@ -92,10 +92,6 @@ pre {
padding: 1ch 1.4ch;
}
-pre:has(> code) {
- background: var(--bg);
-}
-
#pagination {
display: flex;
justify-content: space-between;
diff --git a/frontend/templates/blocks/option.gotmpl b/frontend/templates/blocks/option.gotmpl
new file mode 100644
index 0000000..2248708
--- /dev/null
+++ b/frontend/templates/blocks/option.gotmpl
@@ -0,0 +1,48 @@
+{{- define "main" }}
+ {{- with .Document }}
+
{{ .Name }}
+ {{ markdown .Description }}
+
+ {{- with .Type }}
+ - Type
+ {{ . }}
+ {{- end }}
+ {{- with .Default }}
+ {{- if or .Text .Markdown }}
+ - Default
+ -
+ {{- if .Markdown }}
+ {{ markdown .Markdown }}
+ {{- else }}
+
{{ .Text }}
+ {{- end }}
+
+ {{- end }}
+ {{- end }}
+ {{- with .Example }}
+ {{- if or .Text .Markdown }}
+ - Example
+ -
+ {{- if .Markdown }}
+ {{ markdown .Markdown }}
+ {{- else }}
+
{{ .Text }}
+ {{- end }}
+
+ {{- end }}
+ {{- end }}
+ {{- with .RelatedPackages }}
+ - Related Packages
+ - {{ . }}
+ {{- end }}
+ {{- with .Declarations }}
+ - Declared
+ {{- range . }}
+ -
+ {{ .Name }}
+
+ {{- end }}
+ {{- end }}
+
+ {{- end }}
+{{- end }}
diff --git a/frontend/templates/blocks/package.gotmpl b/frontend/templates/blocks/package.gotmpl
new file mode 100644
index 0000000..a42a8b1
--- /dev/null
+++ b/frontend/templates/blocks/package.gotmpl
@@ -0,0 +1,69 @@
+{{- define "main" }}
+ {{- with .Document }}
+
+ {{- if .Broken }}
+ {{ .Attribute }}
+ {{- else }}
+ {{ .Attribute }}
+ {{- end }}
+
+ {{- if .LongDescription }}
+ {{ markdown .LongDescription }}
+ {{- else }}
+ {{ .Description }}
+ {{- end }}
+
+ {{- with .MainProgram }}
+ - Main Program
+ -
+
{{ . }}
+
+ {{- end }}
+ {{- with .Homepages }}
+ - Homepage
+ -
+ {{- range . }}
+ {{ . }}
+ {{- end }}
+
+ {{- end }}
+ {{- with .Version }}
+ - Version
+ - {{ . }}
+ {{- end }}
+ {{- with .Licenses }}
+ - License
+ -
+ {{- range . }}
+ {{- if .URL }}
+ {{ or .FullName .Name }}
+ {{- else }}
+ {{ or .FullName .Name }}
+ {{- end }}
+ {{- with .AppendixURL }}
+ Appendix
+ {{- end }}
+ {{- end }}
+
+ {{- end }}
+ {{- with .Maintainers }}
+ - Maintainer{{ if gt (len .) 1 }}s{{ end }}
+ -
+ {{- range . }}
+ {{- if .Github }}
+ {{ .Name }}
+ {{- else }}
+ {{ .Name }}
+ {{- end }}
+ {{- end }}
+
+ {{- end }}
+ {{- with .Definition }}
+ - Defined
+ -
+ Source
+
+ {{- end }}
+
+ {{- end }}
+{{- end }}
--
cgit 1.4.1