From 4d5afdc2a6dfbb985fe9030cad7b0b8c3fc74819 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 11 Jan 2018 12:36:56 +0000 Subject: split template in a separate file --- d1pkgweb.go | 102 +----------------------------------------------------------- template.go | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 101 deletions(-) create mode 100644 template.go diff --git a/d1pkgweb.go b/d1pkgweb.go index 6aba272..89fa764 100644 --- a/d1pkgweb.go +++ b/d1pkgweb.go @@ -8,106 +8,6 @@ import ( "strings" ) -var templ = ` - -{{.Name}}-{{.Version}} - -
{{.Name}} {{.Version}} [{{.Section}} - {{.Priority}}]
-
[{{.Suite}} - {{.Component}}]
-
-{{.Description}} -
-
-{{.LongDescription}} -
- -
- -
-{{range .Provides}}
Provides: {{.}}
{{end}} -
- -
-Depends: - -
- -
-Recommends: - -
- - -
-Maintainer: {{.Maintainer}} -
- - -` - func main() { args := os.Args @@ -135,7 +35,7 @@ func main() { if r != nil { for s, err := deb822.ScanStanza(r); s["Package"] != ""; s, err = deb822.ScanStanza(r) { if err == nil { - deb822.Stanza2HtmlPage(s, templ, ".", suite, component) + deb822.Stanza2HtmlPage(s, pkgTempl, ".", suite, component) } else { fmt.Printf("error: %s\n", err) } diff --git a/template.go b/template.go new file mode 100644 index 0000000..97d8e5d --- /dev/null +++ b/template.go @@ -0,0 +1,101 @@ +package main + +var pkgTempl = ` + +{{.Name}}-{{.Version}} + +
{{.Name}} {{.Version}} [{{.Section}} - {{.Priority}}]
+
[{{.Suite}} - {{.Component}}]
+
+{{.Description}} +
+
+{{.LongDescription}} +
+ +
+ +
+{{range .Provides}}
Provides: {{.}}
{{end}} +
+ +
+Depends: + +
+ +
+Recommends: + +
+ + +
+Maintainer: {{.Maintainer}} +
+ + +` -- cgit v1.2.3