Skip to content

Commit 7ed116c

Browse files
Correct the built-in UI size in the README; tidy stale doc comments
The README still described the built-in docs page as ~1.6 KB — its size back at v0.1.0. It has grown to ~10 KB since (security headers, the dismissable notice, method badges, expandable operations), so the figure was off by several times and disagreed with rawui.go. Corrected both README spots and aligned the source comment. Also reworded a couple of doc comments that still referenced the old "Tier" terminology the package overview no longer uses. Logged under Unreleased — docs only, no code change.
1 parent 5415cb6 commit 7ed116c

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10-
Nothing yet.
10+
### Fixed
11+
12+
- The README described the built-in docs page as ~1.6 KB — accurate at
13+
v0.1.0, but it has grown to ~10 KB across the v0.6.x additions (the
14+
security headers, the dismissable notice, method badges, and the
15+
expandable operations). Corrected the figure and aligned it with the
16+
source. Also tidied a couple of stale doc comments left over from
17+
older "Tier" terminology.
1118

1219
## [0.6.7] - 2026-06-14
1320

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The same generated document, rendered by each of the four bundled rich UIs — e
3636

3737
## Features
3838

39-
- **Five UIs** — four rich consoles (Scalar, Swagger UI, Redoc, Stoplight Elements), each CDN-pinned with SRI integrity hashes or fully embedded for air-gapped builds, plus a tiny dependency-free default (~1.6 KB).
39+
- **Five UIs** — four rich consoles (Scalar, Swagger UI, Redoc, Stoplight Elements), each CDN-pinned with SRI integrity hashes or fully embedded for air-gapped builds, plus a tiny dependency-free default (~10 KB).
4040
- **Three OpenAPI versions** — 3.0.4 (default), 3.1.2, and 3.2.0, all externally validated.
4141
- **Reflection** — Go types become JSON Schemas following the `encoding/json` contract, with documentation and validation rules (`minimum`, `maxLength`, `pattern`, `enum`, `default`, …) read from struct tags.
4242
- **Typed parameters** — declare query/header/cookie parameters from a struct or inline with typed, validated modifiers.
@@ -108,7 +108,7 @@ mux := stdocs.New(stdocs.WithTitle("My API"), scalar.WithUI())
108108

109109
| UI | CDN sub-package | Embedded sub-package |
110110
| ------------------------------- | ------------------------------------- | ------------------------------------------ |
111-
| _(default)_ (built-in, ~1.6 KB) |||
111+
| _(default)_ (built-in, ~10 KB) |||
112112
| Scalar | `ui/scalar` (~3.6 MB from the CDN) | `ui/scalaremb` (~3.6 MB in your binary) |
113113
| Swagger UI | `ui/swaggerui` (~1.7 MB from the CDN) | `ui/swaggeruiemb` (~1.7 MB in your binary) |
114114
| Redoc | `ui/redoc` (~1.1 MB from the CDN) | `ui/redocemb` (~1.1 MB in your binary) |

cmd/demo/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Package main is a demo of stdocs using a fictional Task Tracker API.
22
//
3-
// Everything here uses the *stdocs.Mux path (what doc.go calls
4-
// Tier 2). It shows both levels of route documentation:
3+
// Everything here uses the *stdocs.Mux path — the one that builds the
4+
// document from your live routes (see "Two ways to use it" in the
5+
// package docs). It shows both levels of route documentation:
56
//
67
// - zero-config: a route registered with no documentation opts gets
78
// a summary inferred from the function name and a tag from the
@@ -207,7 +208,7 @@ func main() {
207208
scalar.WithUI(),
208209
)
209210

210-
// Tier 2 examples: rich metadata. Each call uses per-route opts
211+
// Documented examples: rich metadata. Each call uses per-route opts
211212
// to document the response body and request body types.
212213
mux.HandleFunc("GET /tasks", listTasks,
213214
stdocs.Summary("List all tasks"),

doc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77
// The pattern syntax it documents ("GET /users/{id}") is the
88
// method+path routing introduced in Go 1.22; the module itself
9-
// requires Go 1.24 or later. There are no dependencies beyond the standard library and
10-
// no code generation: the patterns you already write are the source
11-
// of truth.
9+
// requires Go 1.24 or later. There are no dependencies beyond
10+
// the standard library and no code generation: the patterns you
11+
// already write are the source of truth.
1212
//
1313
// # Two ways to use it
1414
//

rawui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package stdocs
22

33
// defaultUIDoc is the default docs page HTML, served at the docs prefix
4-
// when no UI sub-package is imported. It is a small (~6 KB)
4+
// when no UI sub-package is imported. It is a small (~10 KB)
55
// dependency-free page — no CDN, no external assets — whose inline
66
// script fetches the JSON spec and renders the operations grouped by
77
// path, with method badges, an auth padlock on secured operations, and

0 commit comments

Comments
 (0)