aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md58
-rw-r--r--example.md (renamed from example.txt)0
2 files changed, 58 insertions, 0 deletions
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.txt b/example.md
index 8c5c0eb..8c5c0eb 100644
--- a/example.txt
+++ b/example.md