aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-09-03 14:55:23 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-09-03 14:55:23 +0200
commit3b21449468a1b20b3ff706fe00a04556a804e627 (patch)
tree8054ddc0f47f5731aa89ecb65b962da75a56bdaa /templates
parent1507d12b6398448c53bdffe18a32018a3ef627e7 (diff)
downloadapkdoc-3b21449468a1b20b3ff706fe00a04556a804e627.tar.gz
apkdoc-3b21449468a1b20b3ff706fe00a04556a804e627.tar.bz2
apkdoc-3b21449468a1b20b3ff706fe00a04556a804e627.zip
ref: Remove quicktemplate
This is done in preparation to use text-html/template. This will allow the user to input their own template file
Diffstat (limited to 'templates')
-rw-r--r--templates/index.md.qtpl39
-rw-r--r--templates/index.md.qtpl.go211
2 files changed, 0 insertions, 250 deletions
diff --git a/templates/index.md.qtpl b/templates/index.md.qtpl
deleted file mode 100644
index 434d640..0000000
--- a/templates/index.md.qtpl
+++ /dev/null
@@ -1,39 +0,0 @@
-{% import "fmt" %}
-{% import "strings" %}
-{% import "git.sr.ht/~gabrielgio/apkdoc/parser" %}
-
-{% code
-func reduce(lines []string) string {
- return strings.Join(lines, " ")
-}
-
-func formatLink(e *parser.Entry, format string) string {
- c := strings.Replace(*e.Commit, "-dirty", "", -1)
- return fmt.Sprintf(format, c, *e.Origin)
-}
-%}
-
-{% func MarkdownTemplate(entries []*parser.Entry, format string) %}
-# Apks Alpine 3.18
-{% for _, e := range entries %}
-## {%s e.Name %}
-
-- **Version**: {%s e.Version%}
-- **Description**: {%s e.Description%}{% if e.Maintainer != nil %}
-- **Maintainer**: {%s *e.Maintainer%}{% endif %}
-- **Checksum**:{%s e.Checksum%}{% if e.Architecture != nil %}
-- **Architecture**: {%s *e.Architecture%}{% endif %}
-- **Size**: {%d e.PackageSize%}B
-- **Installed size**: {%d e.InstalledSize%}
-- **Url**: {%s e.Url%}
-- **License**: {%s e.License%}{% if e.Origin != nil %}
-- **Origin**: {%s *e.Origin%}{% endif %}{% if e.BuildTime != nil %}
-- **Build time**: {%s e.BuildTime.String() %}{% endif %}{% if e.Commit != nil %}
-- **Commit**: [{%s *e.Commit %}]({%s formatLink(e, format) %}){% endif %}{% if e.ProviderPriority != nil %}
-- **Provider Priority**: {%d *e.ProviderPriority %}{% endif %}{% if len(e.Dependencies) > 0 %}
-- **Dependencies:**: {%s reduce(e.Dependencies) %}{% endif %}{% if len(e.Provides) > 0 %}
-- **Provides:**: {%s reduce(e.Provides) %}{% endif %}{% if len(e.InstallIf) > 0 %}
-- **Install if:**: {%s reduce(e.InstallIf) %}{% endif %}
-{% endfor %}
-
-{% endfunc %}
diff --git a/templates/index.md.qtpl.go b/templates/index.md.qtpl.go
deleted file mode 100644
index c87d947..0000000
--- a/templates/index.md.qtpl.go
+++ /dev/null
@@ -1,211 +0,0 @@
-// Code generated by qtc from "index.md.qtpl". DO NOT EDIT.
-// See https://github.com/valyala/quicktemplate for details.
-
-//line index.md.qtpl:1
-package templates
-
-//line index.md.qtpl:1
-import "fmt"
-
-//line index.md.qtpl:2
-import "strings"
-
-//line index.md.qtpl:3
-import "git.sr.ht/~gabrielgio/apkdoc/parser"
-
-//line index.md.qtpl:5
-import (
- qtio422016 "io"
-
- qt422016 "github.com/valyala/quicktemplate"
-)
-
-//line index.md.qtpl:5
-var (
- _ = qtio422016.Copy
- _ = qt422016.AcquireByteBuffer
-)
-
-//line index.md.qtpl:6
-func reduce(lines []string) string {
- return strings.Join(lines, " ")
-}
-
-func formatLink(e *parser.Entry, format string) string {
- c := strings.Replace(*e.Commit, "-dirty", "", -1)
- return fmt.Sprintf(format, c, *e.Origin)
-}
-
-//line index.md.qtpl:16
-func StreamMarkdownTemplate(qw422016 *qt422016.Writer, entries []*parser.Entry, format string) {
-//line index.md.qtpl:16
- qw422016.N().S(`
-# Apks Alpine 3.18
-`)
-//line index.md.qtpl:18
- for _, e := range entries {
-//line index.md.qtpl:18
- qw422016.N().S(`
-## `)
-//line index.md.qtpl:19
- qw422016.E().S(e.Name)
-//line index.md.qtpl:19
- qw422016.N().S(`
-
-- **Version**: `)
-//line index.md.qtpl:21
- qw422016.E().S(e.Version)
-//line index.md.qtpl:21
- qw422016.N().S(`
-- **Description**: `)
-//line index.md.qtpl:22
- qw422016.E().S(e.Description)
-//line index.md.qtpl:22
- if e.Maintainer != nil {
-//line index.md.qtpl:22
- qw422016.N().S(`
-- **Maintainer**: `)
-//line index.md.qtpl:23
- qw422016.E().S(*e.Maintainer)
-//line index.md.qtpl:23
- }
-//line index.md.qtpl:23
- qw422016.N().S(`
-- **Checksum**:`)
-//line index.md.qtpl:24
- qw422016.E().S(e.Checksum)
-//line index.md.qtpl:24
- if e.Architecture != nil {
-//line index.md.qtpl:24
- qw422016.N().S(`
-- **Architecture**: `)
-//line index.md.qtpl:25
- qw422016.E().S(*e.Architecture)
-//line index.md.qtpl:25
- }
-//line index.md.qtpl:25
- qw422016.N().S(`
-- **Size**: `)
-//line index.md.qtpl:26
- qw422016.N().D(e.PackageSize)
-//line index.md.qtpl:26
- qw422016.N().S(`B
-- **Installed size**: `)
-//line index.md.qtpl:27
- qw422016.N().D(e.InstalledSize)
-//line index.md.qtpl:27
- qw422016.N().S(`
-- **Url**: `)
-//line index.md.qtpl:28
- qw422016.E().S(e.Url)
-//line index.md.qtpl:28
- qw422016.N().S(`
-- **License**: `)
-//line index.md.qtpl:29
- qw422016.E().S(e.License)
-//line index.md.qtpl:29
- if e.Origin != nil {
-//line index.md.qtpl:29
- qw422016.N().S(`
-- **Origin**: `)
-//line index.md.qtpl:30
- qw422016.E().S(*e.Origin)
-//line index.md.qtpl:30
- }
-//line index.md.qtpl:30
- if e.BuildTime != nil {
-//line index.md.qtpl:30
- qw422016.N().S(`
-- **Build time**: `)
-//line index.md.qtpl:31
- qw422016.E().S(e.BuildTime.String())
-//line index.md.qtpl:31
- }
-//line index.md.qtpl:31
- if e.Commit != nil {
-//line index.md.qtpl:31
- qw422016.N().S(`
-- **Commit**: [`)
-//line index.md.qtpl:32
- qw422016.E().S(*e.Commit)
-//line index.md.qtpl:32
- qw422016.N().S(`](`)
-//line index.md.qtpl:32
- qw422016.E().S(formatLink(e, format))
-//line index.md.qtpl:32
- qw422016.N().S(`)`)
-//line index.md.qtpl:32
- }
-//line index.md.qtpl:32
- if e.ProviderPriority != nil {
-//line index.md.qtpl:32
- qw422016.N().S(`
-- **Provider Priority**: `)
-//line index.md.qtpl:33
- qw422016.N().D(*e.ProviderPriority)
-//line index.md.qtpl:33
- }
-//line index.md.qtpl:33
- if len(e.Dependencies) > 0 {
-//line index.md.qtpl:33
- qw422016.N().S(`
-- **Dependencies:**: `)
-//line index.md.qtpl:34
- qw422016.E().S(reduce(e.Dependencies))
-//line index.md.qtpl:34
- }
-//line index.md.qtpl:34
- if len(e.Provides) > 0 {
-//line index.md.qtpl:34
- qw422016.N().S(`
-- **Provides:**: `)
-//line index.md.qtpl:35
- qw422016.E().S(reduce(e.Provides))
-//line index.md.qtpl:35
- }
-//line index.md.qtpl:35
- if len(e.InstallIf) > 0 {
-//line index.md.qtpl:35
- qw422016.N().S(`
-- **Install if:**: `)
-//line index.md.qtpl:36
- qw422016.E().S(reduce(e.InstallIf))
-//line index.md.qtpl:36
- }
-//line index.md.qtpl:36
- qw422016.N().S(`
-`)
-//line index.md.qtpl:37
- }
-//line index.md.qtpl:37
- qw422016.N().S(`
-
-`)
-//line index.md.qtpl:39
-}
-
-//line index.md.qtpl:39
-func WriteMarkdownTemplate(qq422016 qtio422016.Writer, entries []*parser.Entry, format string) {
-//line index.md.qtpl:39
- qw422016 := qt422016.AcquireWriter(qq422016)
-//line index.md.qtpl:39
- StreamMarkdownTemplate(qw422016, entries, format)
-//line index.md.qtpl:39
- qt422016.ReleaseWriter(qw422016)
-//line index.md.qtpl:39
-}
-
-//line index.md.qtpl:39
-func MarkdownTemplate(entries []*parser.Entry, format string) string {
-//line index.md.qtpl:39
- qb422016 := qt422016.AcquireByteBuffer()
-//line index.md.qtpl:39
- WriteMarkdownTemplate(qb422016, entries, format)
-//line index.md.qtpl:39
- qs422016 := string(qb422016.B)
-//line index.md.qtpl:39
- qt422016.ReleaseByteBuffer(qb422016)
-//line index.md.qtpl:39
- return qs422016
-//line index.md.qtpl:39
-}