From 2590443652805d65858af0e7d3540947f0bef3ff Mon Sep 17 00:00:00 2001 From: Dmitri Aleksandrov Date: Mon, 19 Oct 2026 11:01:47 +0300 Subject: [PATCH] docs: group the pages into Configuration, Rules, Errors and Integrations The Features section had 20 pages in one list. The menu has the tabs Get started, Configuration, Rules, Errors, Integrations and Architecture, the map of the features and llms.txt have the same groups. The URLs of the pages are kept. --- docs/features/index.md | 43 +++++++++++++++++++++++++++--------------- mkdocs.yml | 42 +++++++++++++++++++++++++++++++++-------- 2 files changed, 62 insertions(+), 23 deletions(-) diff --git a/docs/features/index.md b/docs/features/index.md index c6fa80a..6587f4e 100644 --- a/docs/features/index.md +++ b/docs/features/index.md @@ -1,37 +1,50 @@ # Features -Reference of valigo capabilities grouped by area. +The map of valigo, in the order of the menu. ## Configuration +How the rules are configured and composed. + | Page | What's inside | |---|---| | [Validator and Configure](configure.md) | `New` and its options, `Configure`, the model, field pointers, nested and recursive structs | -| [Types and conversions](conversions.md) | `Field`, `Slice` and `As`, the built-in conversions, conversions of your types | +| [Types and conversions](conversions.md) | `Field`, `Slice`, `Map` and `As`, the built-in conversions, conversions of your types | | [Absent values](absent.md) | nil pointers, nil slices and nil nested structs: which rules skip them | -| [Conditions](conditions.md) | `When` on the struct and on a field | -| [Rules on other fields](fields.md) | `EqualField`, `MinField`, `MaxField`, `BeforeField`, `AfterField`: comparisons with another field by its pointer | -| [Custom rules](custom.md) | `Custom` on a field, on a slice and on the struct | +| [Conditions](conditions.md) | `When` on the struct and on a field, conditional requiredness | +| [Custom rules](custom.md) | `Custom` on a field, on a slice and on the struct, rules with limits from data | +| [Rules on other fields](fields.md) | `EqualField`, `MinField`, `MaxField`, `BeforeField`, `AfterField` by the pointer of the other field | ## Rules +The built-in rules of every type. + | Page | What's inside | |---|---| -| [Strings](strings.md) | `str.Of`: `Required`, lengths, `AnyOf`, `Prefix`, `Suffix`, `Contains`, `Regexp`, `Email`, `URL`, `IP`, `Hostname`, `UUID`, `Alphanumeric`, `Trim` | -| [Numbers](numbers.md) | `num.Of` and `num.Ptr`: `Required`, `Min`, `Max`, `AnyOf`, `AnyOfInterval` | +| [Strings](strings.md) | `str.Of`: lengths, `AnyOf`, substrings, `Regexp`, `Email`, `URL`, `IP`, `CIDR`, `MAC`, `Hostname`, `UUID`, `E164`, `Base64`, `JSON`, `Semver`, `Datetime`, ISO codes, `CreditCard`, `Trim` | +| [Numbers](numbers.md) | `num.Of`, `num.Ptr`: `Required`, `Min`, `Max`, `AnyOf`, `AnyOfInterval`, `Latitude`, `Longitude` | | [Time](time.md) | `timex.Of`: `Required`, `Before`, `After`, `Between`, `InPast`, `InFuture` | -| [Comparable values](values.md) | `eq.Of`, `eq.Ptr`, `eq.Slice`: enums, bools — `Required`, `OneOf`, `NotOneOf`, `Equal`, `NotEqual`, `Unique` | +| [Comparable values](values.md) | `eq.Of`, `eq.Ptr`, `eq.Slice`: enums, bools — `OneOf`, `NotOneOf`, `Equal`, `NotEqual`, `Unique` | | [UUID](uuid.md) | `uuid.Of` of the separate module: `Required`, `AnyOf` | +| [Slices](slices.md) | `Slice` and the slice conversions: length rules, `Each` for the elements | | [Maps](maps.md) | `Map`: length rules, `EachKey` and `EachValue` with conversions | -| [Slices](slices.md) | `Slice`, `str.Slice`, `uuid.Slice`: length rules, `Each` for elements | -## Results +## Errors + +What a validation returns. | Page | What's inside | |---|---| -| [Errors](errors.md) | `Validate` and `ValidateTyped`, `shared.Error`, locations of fields and elements, errors transformer | +| [Errors](errors.md) | `Validate` and `ValidateTyped`, `shared.Error`, locations, codes for clients, errors transformer | +| [Translations](translations.md) | built-in locales, plural forms, own messages, languages from the context, `Accept-Language` middleware | | [HTTP problem details](problem.md) | `problem`: the errors as `application/problem+json` of RFC 9457 with JSON pointers and codes | -| [gin](gin.md) | the module `github.com/insei/valigo/gin`: the `binding.StructValidator` of gin and validation with the language of the request | -| [echo](echo.md) | the module `github.com/insei/valigo/echo`: the `echo.Validator` and validation with the language of the request | -| [huma](huma.md) | the module `github.com/insei/valigo/huma`: valigo rules in the `Resolve` of huma inputs | -| [Translations](translations.md) | Built-in locales, own messages, languages from the context, `Accept-Language` middleware | + +## Integrations + +The separate modules for the frameworks. + +| Page | What's inside | +|---|---| +| [huma](huma.md) | `github.com/insei/valigo/huma`: the rules in the `Resolve` of huma inputs with the locations of huma | +| [gin](gin.md) | `github.com/insei/valigo/gin`: the `binding.StructValidator` of gin and validation with the language of the request | +| [echo](echo.md) | `github.com/insei/valigo/echo`: the `echo.Validator` and validation with the language of the request | diff --git a/mkdocs.yml b/mkdocs.yml index 7ba9169..30f3daa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -70,12 +70,13 @@ extra: link: https://pkg.go.dev/github.com/insei/valigo nav: - - Get started: index.md - - Why valigo?: why-valigo.md - - Upgrading from v0.0.x: upgrading.md - - Performance: performance.md - - For AI agents: ai-agents.md - - Features: + - Get started: + - index.md + - Why valigo?: why-valigo.md + - Performance: performance.md + - Upgrading from v0.0.x: upgrading.md + - For AI agents: ai-agents.md + - Configuration: - features/index.md - Validator and Configure: features/configure.md - Types and conversions: features/conversions.md @@ -83,6 +84,7 @@ nav: - Conditions: features/conditions.md - Custom rules: features/custom.md - Rules on other fields: features/fields.md + - Rules: - Strings: features/strings.md - Numbers: features/numbers.md - Time: features/time.md @@ -90,9 +92,11 @@ nav: - UUID: features/uuid.md - Slices: features/slices.md - Maps: features/maps.md + - Errors: - Errors: features/errors.md - Translations: features/translations.md - HTTP problem details: features/problem.md + - Integrations: - huma: features/huma.md - gin: features/gin.md - echo: features/echo.md @@ -122,7 +126,29 @@ plugins: - performance.md: benchmarks with go-playground/validator, ozzo-validation, zog, gookit/validate and hand-written code - upgrading.md: upgrading from v0.0.x - ai-agents.md: the skill for AI agents - Features: - - features/*.md + Configuration: + - features/index.md: the map of the features + - features/configure.md: the validator, Configure, the model, field pointers + - features/conversions.md: Field, Slice, Map and As, the built-in conversions, conversions of your types + - features/absent.md: nil pointers and nil nested structs + - features/conditions.md: When on the struct and on fields, conditional requiredness + - features/custom.md: Custom rules, rules from data + - features/fields.md: rules on other fields + Rules: + - features/strings.md: the rules and formats of strings + - features/numbers.md: the rules of numbers + - features/time.md: the rules of time.Time + - features/values.md: the rules of comparable values, enums, bools + - features/uuid.md: the rules of uuids, the separate module + - features/slices.md: the rules of slices and their elements + - features/maps.md: the rules of maps, their keys and values + Errors: + - features/errors.md: Validate, shared.Error, locations, codes for clients + - features/translations.md: locales, plural forms, languages from the context + - features/problem.md: problem details of RFC 9457 + Integrations: + - features/huma.md: huma inputs + - features/gin.md: gin binding + - features/echo.md: echo validator Architecture: - architecture/*.md