Update Docs

This commit is contained in:
6543 2021-02-02 02:43:59 +01:00
parent fd3ef77fa6
commit 425849f4f8
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
2 changed files with 12 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
avatars
.idea

View File

@ -1,12 +1,18 @@
# Golang port of DiceBear Avatars, which in turn were inspired by 8biticon avatars # Golang port of DiceBear Avatars, which in turn were inspired by 8biticon avatars
## Build & Run ## Usage
import `codeberg.org/Codeberg/avatars`
and use `string svg = avatars.MakeAvatar(seed)`
## Build & Use Example
```shell ```shell
# will build the binary into ${BUILDDIR}. The golang compiler is fetched and installed into $PWD/gitea/bin/ # will build the binary
make BUILDDIR=$PWD go build -o avatars example/main.go
# Create a random avatar and write it to /tmp/avatar.svg # Create a random avatar and write it to /tmp/avatar.svg
$PWD/gitea/bin/avatar my-special-seed-string > /tmp/avatar.svg ./avatars my-special-seed-string > /tmp/avatar.svg
# Open SVG file with default image viewer # Open SVG file with default image viewer
xdg-open /tmp/avatar.svg xdg-open /tmp/avatar.svg
``` ```