1
0
mirror of https://github.com/Luzifer/badge-gen.git synced 2024-09-16 13:58:32 +00:00

Add documentation for configuration

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-03-11 13:48:20 +01:00
parent 035e378483
commit 01d5ecc648
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D
4 changed files with 20 additions and 0 deletions

4
Makefile Normal file
View File

@ -0,0 +1,4 @@
documentation:
echo "| Key | Type | Description |" >config.md
echo "| --- | ---- | ----------- |" >>config.md
awk -F ' - ' '/#configStore/{ gsub(/.*configStore /, "", $$1); printf "| %s | %s | %s |\n", $$1, $$2, $$3 }' *.go | sort >>config.md

View File

@ -32,6 +32,16 @@ To embed them into Markdown pages like this `README.md`:
- There is a [Docker container](https://quay.io/repository/luzifer/badge-gen) for it. Just start it and use your own URL
For configuration options see [config.md](config.md). These need to be supplied in a YAML file:
```yaml
---
key: value
...
```
### Popular buttons rebuilt
Hint: To get the source just look into the source of this README.md

4
config.md Normal file
View File

@ -0,0 +1,4 @@
| Key | Type | Description |
| --- | ---- | ----------- |
| github.personal_token | string | Token for Github auth to increase API requests |
| github.username | string | Username for Github auth to increase API requests |

View File

@ -298,6 +298,8 @@ func (g githubServiceHandler) fetchAPI(ctx context.Context, path string, headers
}
}
// #configStore github.username - string - Username for Github auth to increase API requests
// #configStore github.personal_token - string - Token for Github auth to increase API requests
if configStore.Str("github.personal_token") != "" {
req.SetBasicAuth(configStore.Str("github.username"), configStore.Str("github.personal_token"))
}