1{% import "git.sr.ht/~gabrielgio/apkdoc/parser" %}
2{% import "strings" %}
3
4{% code
5func reduce(lines []string) string {
6 return strings.Join(lines, " ")
7}
8%}
9
10{% func MarkdownTemplate(entries []*parser.Entry) %}
11# Apks Alpine 3.18
12{% for _, e := range entries %}
13## {%s e.Name %}
14
15- **Version**: {%s e.Version%}
16- **Description**: {%s e.Description%}{% if e.Maintainer != nil %}
17- **Maintainer**: {%s *e.Maintainer%}{% endif %}
18- **Checksum**:{%s e.Checksum%}{% if e.Architecture != nil %}
19- **Architecture**: {%s *e.Architecture%}{% endif %}
20- **Size**: {%d e.PackageSize%}B
21- **Installed size**: {%d e.InstalledSize%}
22- **Url**: {%s e.Url%}
23- **License**: {%s e.License%}{% if e.Origin != nil %}
24- **Origin**: {%s *e.Origin%}{% endif %}{% if e.BuildTime != nil %}
25- **Build time**: {%s e.BuildTime.String() %}{% endif %}{% if e.Commit != nil %}
26- **Commit**: {%s *e.Commit %}{% endif %}{% if e.ProviderPriority != nil %}
27- **Provider Priority**: {%d *e.ProviderPriority %}{% endif %}{% if len(e.Dependencies) > 0 %}
28- **Dependencies:**: {%s reduce(e.Dependencies) %}{% endif %}{% if len(e.Provides) > 0 %}
29- **Provides:**: {%s reduce(e.Provides) %}{% endif %}{% if len(e.InstallIf) > 0 %}
30- **Install if:**: {%s reduce(e.InstallIf) %}{% endif %}
31{% endfor %}
32
33{% endfunc %}