From 3b21449468a1b20b3ff706fe00a04556a804e627 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 3 Sep 2023 14:55:23 +0200 Subject: ref: Remove quicktemplate This is done in preparation to use text-html/template. This will allow the user to input their own template file --- templates/index.md.qtpl | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 templates/index.md.qtpl (limited to 'templates/index.md.qtpl') 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 %} -- cgit v1.2.3