Skip to content

Commit bd6097c

Browse files
committed
docs: readme
1 parent 3d16225 commit bd6097c

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
<!-- test-count:embed:end -->
1919
</p>
2020

21+
`web` is built on top of [Echo](https://echo.labstack.com/), which is a fantastic HTTP framework with a fast router, strong middleware story, and a mature ecosystem. GoForj wraps it so applications can code against a smaller app-facing contract while still getting a high-quality underlying engine, reusable middleware packages, testing helpers, route indexing, and framework-owned integration points like Prometheus and generated wiring.
22+
2123
<!-- package-coverage:embed:start -->
22-
| Package | Coverage |
23-
|------|---------:|
24-
| `web` | 94.3% |
25-
| `adapter/echoweb` | 90.0% |
26-
| `webindex` | 90.3% |
27-
| `webmiddleware` | 89.2% |
28-
| `webprometheus` | 89.8% |
29-
| `webtest` | 100.0% |
24+
<img src="https://img.shields.io/badge/web-94.3%25-4c9a2a" alt="web coverage">
25+
<img src="https://img.shields.io/badge/adapter--echoweb-90.0%25-4c9a2a" alt="adapter/echoweb coverage">
26+
<img src="https://img.shields.io/badge/webindex-90.3%25-4c9a2a" alt="webindex coverage">
27+
<img src="https://img.shields.io/badge/webmiddleware-89.2%25-4c9a2a" alt="webmiddleware coverage">
28+
<img src="https://img.shields.io/badge/webprometheus-91.4%25-4c9a2a" alt="webprometheus coverage">
29+
<img src="https://img.shields.io/badge/webtest-100.0%25-4c9a2a" alt="webtest coverage">
3030
<!-- package-coverage:embed:end -->
3131

32-
`web` is built on top of [Echo](https://echo.labstack.com/), which is a fantastic HTTP framework with a fast router, strong middleware story, and a mature ecosystem. GoForj wraps it so applications can code against a smaller app-facing contract while still getting a high-quality underlying engine, reusable middleware packages, testing helpers, route indexing, and framework-owned integration points like Prometheus and generated wiring.
33-
3432
## Installation
3533

3634
```bash

docs/readme/testcounts/main.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,25 @@ func renderBadges(unitCount int) string {
222222
}
223223

224224
func renderPackageCoverageTable(items []packageCoverage) string {
225-
lines := []string{
226-
"| Package | Coverage |",
227-
"|------|---------:|",
228-
}
225+
lines := make([]string, 0, len(items))
229226
for _, item := range items {
230227
percent := 0.0
231228
if item.Total > 0 {
232229
percent = (float64(item.Covered) / float64(item.Total)) * 100
233230
}
234-
lines = append(lines, fmt.Sprintf("| `%s` | %.1f%% |", item.Name, percent))
231+
lines = append(lines, fmt.Sprintf(`<img src="https://img.shields.io/badge/%s-%.1f%%25-4c9a2a" alt="%s coverage">`, badgeLabel(item.Name), percent, item.Name))
235232
}
236233
return strings.Join(lines, "\n")
237234
}
238235

236+
func badgeLabel(name string) string {
237+
replacer := strings.NewReplacer(
238+
"/", "--",
239+
" ", "_",
240+
)
241+
return replacer.Replace(name)
242+
}
243+
239244
func replaceSection(input, start, end, replacement string) (string, error) {
240245
si := strings.Index(input, start)
241246
ei := strings.Index(input, end)

0 commit comments

Comments
 (0)