aboutsummaryrefslogtreecommitdiff
path: root/templates/index.md.qtpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.md.qtpl')
-rw-r--r--templates/index.md.qtpl33
1 files changed, 33 insertions, 0 deletions
diff --git a/templates/index.md.qtpl b/templates/index.md.qtpl
new file mode 100644
index 0000000..879795a
--- /dev/null
+++ b/templates/index.md.qtpl
@@ -0,0 +1,33 @@
+{% import "git.sr.ht/~gabrielgio/apkdoc/parser" %}
+{% import "strings" %}
+
+{% code
+func reduce(lines []string) string {
+ return strings.Join(lines, " ")
+}
+%}
+
+{% func MarkdownTemplate(entries []*parser.Entry) %}
+# 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 %}{% 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 %}