From 9b4b5c2fe3aa1042d4bab8cef94b154ae85cad24 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 17 Sep 2023 19:13:39 +0200 Subject: doc: Add README --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ example.md | 8 ++++++++ example.txt | 8 -------- 3 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 README.md create mode 100644 example.md delete mode 100644 example.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..93f352c --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# APKDOC + +Document generator for alpine's index format v2 file[^1]. + +## Usage example + +```sh +apkdoc \ + -t text \ + -u https://alpine.mirror.wearetriple.com/v3.18/main/x86_64/APKINDEX.tar.gz \ + -f example.md \ + -o index.txt +``` + +## Data + +`apkdoc` offers a list of the following struct to the template: + +```go +type Entry struct { + Checksum string // C + Version string // V + Name string // P + Architecture *string // A + PackageSize int // S + InstalledSize int // I + Description string // T + Url string // U + License string // L + Origin *string // o + Maintainer *string // m + BuildTime *time.Time // t + Commit *string // c + ProviderPriority *int // k + Dependencies []string // D + Provides []string // p + InstallIf []string // i +} +``` + +## Functions + +`apkdoc` also offers a couple help functions. + +### `DerefI` + +Deref int pointer. + +### `DerefS` + +Deref string pointer. + +### `Properties` + +A `Entry` function that generate a map of with lower cased space separated +property name. + +[^1]: https://wiki.alpinelinux.org/wiki/Apk_spec diff --git a/example.md b/example.md new file mode 100644 index 0000000..8c5c0eb --- /dev/null +++ b/example.md @@ -0,0 +1,8 @@ +# Apks Alpine 3.18 + +{{ range $e := . }} +## {{ $e.Name }} + +{{ range $name, $value := ($e.Properties) }}- **{{$name}}**: {{ $value }} +{{ end }} +{{ end }} diff --git a/example.txt b/example.txt deleted file mode 100644 index 8c5c0eb..0000000 --- a/example.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Apks Alpine 3.18 - -{{ range $e := . }} -## {{ $e.Name }} - -{{ range $name, $value := ($e.Properties) }}- **{{$name}}**: {{ $value }} -{{ end }} -{{ end }} -- cgit v1.2.3