Skip to content

Commit aaf4f1d

Browse files
authored
docs: prioritize examples and shorten notes
1 parent 710be4a commit aaf4f1d

1 file changed

Lines changed: 37 additions & 55 deletions

File tree

README.md

Lines changed: 37 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,6 @@ So I decided to recreate it.
2020
> [!NOTE]
2121
> I'll try to keep this domain name up as much as possible, so wish me a long life 🙂
2222
23-
## 📜 API Contract
24-
25-
### Endpoint
26-
27-
- `GET /progress/{percentage}`
28-
- `HEAD /progress/{percentage}`
29-
30-
`percentage` can be an integer or float and is clamped to `0..100`.
31-
32-
### Query params
33-
34-
- `dangerColor`
35-
- `warningColor`
36-
- `successColor`
37-
- `barColor` (overrides the bar fill color)
38-
- `label` (custom text inside the bar, max 64 chars)
39-
- `min`
40-
- `max`
41-
42-
All color values must be 6-character hex values without `#` (example: `ff9900`).
43-
`min` and `max` must be provided together when used.
44-
45-
### Response behavior
46-
47-
- `200 OK`: valid request, returns SVG.
48-
- `400 Bad Request`: invalid numeric input, range config, label length, or color format.
49-
- `405 Method Not Allowed`: any method different from `GET` or `HEAD`.
50-
- `500 Internal Server Error`: template parse/render failure.
51-
52-
Headers for successful responses:
53-
54-
- `Content-Type: image/svg+xml`
55-
- `Cache-Control: public, max-age=300`
56-
57-
> [!TIP]
58-
> `percentage` values outside `0..100` are accepted and clamped automatically.
59-
6023
## ✨ Examples
6124

6225
> [!TIP]
@@ -67,8 +30,6 @@ Headers for successful responses:
6730
![](https://geps.dev/progress/10)
6831

6932
> [!NOTE]
70-
> URL: `https://geps.dev/progress/10`
71-
> Markdown:
7233
> ```md
7334
> ![](https://geps.dev/progress/10)
7435
> ```
@@ -78,8 +39,6 @@ Headers for successful responses:
7839
![](https://geps.dev/progress/76.5)
7940
8041
> [!NOTE]
81-
> URL: `https://geps.dev/progress/76.5`
82-
> Markdown:
8342
> ```md
8443
> ![](https://geps.dev/progress/76.5)
8544
> ```
@@ -89,8 +48,6 @@ Headers for successful responses:
8948
![](https://geps.dev/progress/150)
9049
9150
> [!NOTE]
92-
> URL: `https://geps.dev/progress/150`
93-
> Markdown:
9451
> ```md
9552
> ![](https://geps.dev/progress/150)
9653
> ```
@@ -100,8 +57,6 @@ Headers for successful responses:
10057
![](https://geps.dev/progress/-10)
10158
10259
> [!NOTE]
103-
> URL: `https://geps.dev/progress/-10`
104-
> Markdown:
10560
> ```md
10661
> ![](https://geps.dev/progress/-10)
10762
> ```
@@ -113,8 +68,6 @@ Headers for successful responses:
11368
![](https://geps.dev/progress/75?dangerColor=800000&warningColor=ff9900&successColor=006600)
11469
11570
> [!NOTE]
116-
> URL pattern: `https://geps.dev/progress/{value}?dangerColor=800000&warningColor=ff9900&successColor=006600`
117-
> Markdown:
11871
> ```md
11972
> ![](https://geps.dev/progress/50?dangerColor=800000&warningColor=ff9900&successColor=006600)
12073
> ```
@@ -124,8 +77,6 @@ Headers for successful responses:
12477
![](https://geps.dev/progress/50?barColor=4472C4)
12578
12679
> [!NOTE]
127-
> URL: `https://geps.dev/progress/50?barColor=4472C4`
128-
> Markdown:
12980
> ```md
13081
> ![](https://geps.dev/progress/50?barColor=4472C4)
13182
> ```
@@ -135,8 +86,6 @@ Headers for successful responses:
13586
![](https://geps.dev/progress/186?label=186&min=0&max=241&barColor=4472C4)
13687
13788
> [!NOTE]
138-
> URL: `https://geps.dev/progress/186?label=186&min=0&max=241&barColor=4472C4`
139-
> Markdown:
14089
> ```md
14190
> ![](https://geps.dev/progress/186?label=186&min=0&max=241&barColor=4472C4)
14291
> ```
@@ -146,8 +95,6 @@ Headers for successful responses:
14695
![](https://geps.dev/progress/50?min=0&max=200)
14796
14897
> [!NOTE]
149-
> URL: `https://geps.dev/progress/50?min=0&max=200`
150-
> Markdown:
15198
> ```md
15299
> ![](https://geps.dev/progress/50?min=0&max=200)
153100
> ```
@@ -157,12 +104,47 @@ Headers for successful responses:
157104
![](https://geps.dev/progress/70?label=Sprint%201)
158105
159106
> [!NOTE]
160-
> URL: `https://geps.dev/progress/70?label=Sprint%201`
161-
> Markdown:
162107
> ```md
163108
> ![](https://geps.dev/progress/70?label=Sprint%201)
164109
> ```
165110
111+
## 📜 API Contract
112+
113+
### Endpoint
114+
115+
- `GET /progress/{percentage}`
116+
- `HEAD /progress/{percentage}`
117+
118+
`percentage` can be an integer or float and is clamped to `0..100`.
119+
120+
### Query params
121+
122+
- `dangerColor`
123+
- `warningColor`
124+
- `successColor`
125+
- `barColor` (overrides the bar fill color)
126+
- `label` (custom text inside the bar, max 64 chars)
127+
- `min`
128+
- `max`
129+
130+
All color values must be 6-character hex values without `#` (example: `ff9900`).
131+
`min` and `max` must be provided together when used.
132+
133+
### Response behavior
134+
135+
- `200 OK`: valid request, returns SVG.
136+
- `400 Bad Request`: invalid numeric input, range config, label length, or color format.
137+
- `405 Method Not Allowed`: any method different from `GET` or `HEAD`.
138+
- `500 Internal Server Error`: template parse/render failure.
139+
140+
Headers for successful responses:
141+
142+
- `Content-Type: image/svg+xml`
143+
- `Cache-Control: public, max-age=300`
144+
145+
> [!TIP]
146+
> `percentage` values outside `0..100` are accepted and clamped automatically.
147+
166148
## 🛠️ Local Development
167149
168150
### Prerequisites

0 commit comments

Comments
 (0)