Skip to content

Commit 9f4c330

Browse files
Merge pull request #1 from ArthurLobopro/improve-docs
Improve docs
2 parents f57360f + 4893408 commit 9f4c330

File tree

12 files changed

+218
-14
lines changed

12 files changed

+218
-14
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,46 @@ jobs:
7979
outputs: |
8080
dist/grid-snake.svg
8181
dist/grid-snake-dark.svg?palette=github-dark
82-
dist/grid-without-progressbar.svg?hide_stack=true
83-
dist/grid-snake-long.svg?snake_size=5
82+
dist/grid-snake-colored.svg?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
8483
8584
- name: ensure the generated file exists
8685
run: |
8786
ls dist
8887
test -f dist/grid-snake.svg
8988
test -f dist/grid-snake-dark.svg
90-
test -f dist/grid-without-progressbar.svg
91-
test -f dist/grid-snake-long.svg
89+
test -f dist/grid-snake-colored.svg
90+
91+
- name: Generate Without Progressbar
92+
uses: ./svg-only
93+
with:
94+
github_user_name: arthurlobopro
95+
outputs: |
96+
dist/stack/grid-without-progressbar.svg?hide_stack=true
97+
dist/stack/grid-without-progressbar-dark.svg?hide_stack=true&palette=github-dark
98+
99+
- name: ensure the generated file exists
100+
run: |
101+
ls dist/stack
102+
test -f dist/stack/grid-without-progressbar.svg
103+
test -f dist/stack/grid-without-progressbar-dark.svg
104+
105+
- name: Generate Snake Sizes
106+
uses: ./svg-only
107+
with:
108+
github_user_name: arthurlobopro
109+
outputs: |
110+
dist/size/grid-snake-short.svg?snake_size=2
111+
dist/size/grid-snake-short-dark.svg?snake_size=2&palette=github-dark
112+
dist/size/grid-snake-long.svg?snake_size=6
113+
dist/size/grid-snake-long-dark.svg?snake_size=6&palette=github-dark
114+
115+
- name: Ensure Size Outputs Exists
116+
run: |
117+
ls dist/size
118+
test -f dist/size/grid-snake-short.svg
119+
test -f dist/size/grid-snake-short-dark.svg
120+
test -f dist/size/grid-snake-long.svg
121+
test -f dist/size/grid-snake-long-dark.svg
92122
93123
- name: Generate Speed Custom
94124
uses: ./svg-only
@@ -98,14 +128,20 @@ jobs:
98128
dist/speed/grid-snake-slow.svg?speed=slow
99129
dist/speed/grid-snake-normal.svg?speed=normal
100130
dist/speed/grid-snake-fast.svg?speed=fast
131+
dist/speed/grid-snake-slow-dark.svg?speed=slow&palette=github-dark
132+
dist/speed/grid-snake-normal-dark.svg?speed=normal&palette=github-dark
133+
dist/speed/grid-snake-fast-dark.svg?speed=fast&palette=github-dark
101134
102135
- name: Ensure Speed Outputs Exists
103136
run: |
104137
ls dist/speed
105138
test -f dist/speed/grid-snake-slow.svg
106139
test -f dist/speed/grid-snake-normal.svg
107140
test -f dist/speed/grid-snake-fast.svg
108-
141+
test -f dist/speed/grid-snake-slow-dark.svg
142+
test -f dist/speed/grid-snake-normal-dark.svg
143+
test -f dist/speed/grid-snake-fast-dark.svg
144+
109145
- name: Generate Dot Shape Custom
110146
uses: ./svg-only
111147
with:
@@ -114,13 +150,19 @@ jobs:
114150
dist/shape/grid-snake-square.svg?dot_shape=square
115151
dist/shape/grid-snake-rounded-square.svg?dot_shape=rounded-square
116152
dist/shape/grid-snake-circle.svg?dot_shape=circle
117-
153+
dist/shape/grid-snake-square-dark.svg?dot_shape=square&palette=github-dark
154+
dist/shape/grid-snake-rounded-square-dark.svg?dot_shape=rounded-square&palette=github-dark
155+
dist/shape/grid-snake-circle-dark.svg?dot_shape=circle&palette=github-dark
156+
118157
- name: Ensure Speed Outputs Exists
119158
run: |
120159
ls dist/shape
121160
test -f dist/shape/grid-snake-square.svg
122161
test -f dist/shape/grid-snake-rounded-square.svg
123162
test -f dist/shape/grid-snake-circle.svg
163+
test -f dist/shape/grid-snake-square-dark.svg
164+
test -f dist/shape/grid-snake-rounded-square-dark.svg
165+
test -f dist/shape/grid-snake-circle-dark.svg
124166
125167
- uses: crazy-max/ghaction-github-pages@v3.1.0
126168
with:

.vscode/settings.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"[typescript]": {
3-
"editor.defaultFormatter": "esbenp.prettier-vscode",
4-
"editor.formatOnSave": true
5-
}
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true
64
}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ Available as github action. It can automatically generate a new image each day.
5050
# - color_dots: Coma separated list of dots color.
5151
# The first one is 0 contribution, then it goes from the low contribution to the highest.
5252
# Exactly 5 colors are expected.
53-
# - hide_stack: On svg builds, you can hide the progressbar by this option
53+
# - hide_stack: If should hide progressbar, by default is false
54+
# - dot_shape: The shape of the contribution dots,
55+
# must be one of [square, square-rounded, circle].
56+
# By default is square-rounded.
57+
# - speed: The speed of animation, must be one of [fast, normal, slow].
58+
# By default is normal
59+
# - snake_size: The size of the snake, must be a number between 1 and 6.
60+
# By default is 4.
61+
5462
outputs: |
5563
dist/github-snake.svg
5664
dist/github-snake-dark.svg?palette=github-dark

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ inputs:
2727
- color_dots: Coma separated list of dots color.
2828
The first one is 0 contribution, then it goes from the low contribution to the highest.
2929
Exactly 5 colors are expected.
30-
- hide_stack: On svg builds, you can hide the progressbar by this option
30+
- hide_stack: If should hide progressbar, by default is false
31+
- dot_shape: The shape of the contribution dots,
32+
must be one of [square, square-rounded, circle].
33+
By default is square-rounded.
34+
- speed: The speed of animation, must be one of [fast, normal, slow].
35+
By default is normal
36+
- snake_size: The size of the snake, must be a number between 1 and 6.
37+
By default is 4.
38+
3139
example:
3240
outputs: |
3341
dark.svg?palette=github-dark&color_snake=blue&hide_stack=true

docs/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SNK Api
2+
3+
## Samples
4+
5+
- [Palette](./samples/palette.md)
6+
- [Custom Colors](./samples/colors.md)
7+
- [Hide Progressbar (Stack)](./samples/progressbar.md)
8+
- [Snake Size](./samples/snake-size.md)
9+
- [Dot Shape](./samples/dot-shape.md)
10+
- [Speed](./samples/speed.md)

docs/samples/colors.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Custom Colors
2+
3+
You can customize the snake color by the `color_snake` option and the dots colors by the `color_dots` option.
4+
5+
The `color_snake` option must be a named color or a hexadecimal color.
6+
The `color_dots` option must be a array of 5 colors. The first one is 0 contribution, then it goes from the low contribution to the highest.
7+
8+
### Custom Color Sample:
9+
10+
```yml
11+
color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
12+
```
13+
14+
![Color Sample](https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake-colored.svg)

docs/samples/dot-shape.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dot Shape Samples
2+
3+
The `dot_shape` option must be one of `square`, `square-rounded` or `circle`
4+
5+
Here are `dot_shape` samples:
6+
7+
### dot_shape=square
8+
9+
<picture>
10+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-square-dark.svg">
11+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-square.svg">
12+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-square.svg">
13+
</picture>
14+
15+
### dot_shape=square-rounded
16+
17+
<picture>
18+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-rounded-square-dark.svg">
19+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-rounded-square.svg">
20+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-rounded-square.svg">
21+
</picture>
22+
23+
### dot_shape=circle
24+
25+
<picture>
26+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-circle-dark.svg">
27+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-circle.svg">
28+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/shape/grid-snake-circle.svg">
29+
</picture>

docs/samples/palette.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Palette samples
2+
3+
The `palette` option must be one of `github`, `github-dark` or `github-light`.
4+
5+
The options `github` and `github-light` are the same palette.
6+
7+
Here are some `palette` samples:
8+
9+
### palette=github or palette=github-light
10+
11+
![Light palette](https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake.svg)
12+
13+
### palette=github-dark
14+
15+
![Dark palette](https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake-dark.svg)

docs/samples/progressbar.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Progressbar (Stack)
2+
3+
The `hide_stack` option must be boolean and by default it's `false`
4+
5+
Here are `hide_stack` samples:
6+
7+
### hide_stack=false
8+
9+
<picture>
10+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake-dark.svg">
11+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake.svg">
12+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake.svg">
13+
</picture>
14+
15+
### hide_stack=true
16+
17+
<picture>
18+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/stack/grid-without-progressbar-dark.svg">
19+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/stack/grid-without-progressbar.svg">
20+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/stack/grid-without-progressbar.svg">
21+
</picture>

docs/samples/snake-size.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Snake Size samples
2+
3+
The `snake_size` option must be an integer between 1 and 6.
4+
5+
Here are some `snake_size` samples:
6+
7+
### snake_size=2
8+
9+
<picture>
10+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-short-dark.svg">
11+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-short.svg">
12+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-short.svg">
13+
</picture>
14+
15+
### snake_size=4
16+
17+
<picture>
18+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake-dark.svg">
19+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake.svg">
20+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/grid-snake.svg">
21+
</picture>
22+
23+
### snake_size=6
24+
25+
<picture>
26+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-long-dark.svg">
27+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-long.svg">
28+
<img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/ArthurLobopro/snk/output-svg-only/size/grid-snake-long.svg">

0 commit comments

Comments
 (0)