From 35ea95c6f03b7fed1b903dfbcc0922cb4ea962ee Mon Sep 17 00:00:00 2001 From: Henrique Moody Date: Tue, 6 Jan 2026 10:30:42 +0100 Subject: [PATCH] Remove number prefixes from Markdown files We used to have those to preserve the order of the pages when generating the documentation with MkDocs. This commit introduces the `mkdocs-nav-weight`, that allows us to make that order without having those prefixes. --- README.md | 6 +++--- docs/{08-comparable-values.md => comparable-values.md} | 0 docs/{06-concrete-api.md => concrete-api.md} | 0 docs/{07-custom-validators.md => custom-validators.md} | 0 docs/{02-feature-guide.md => feature-guide.md} | 4 ++++ docs/{03-handling-exceptions.md => handling-exceptions.md} | 0 docs/index.md | 6 +++--- docs/{01-installation.md => installation.md} | 0 docs/{10-license.md => license.md} | 4 ++++ ...ors-by-category.md => list-of-validators-by-category.md} | 0 ...lder-conversion.md => message-placeholder-conversion.md} | 0 docs/{04-message-translation.md => message-translation.md} | 0 docs/requirements.txt | 1 + docs/validators/Between.md | 2 +- docs/validators/BetweenExclusive.md | 2 +- docs/validators/GreaterThan.md | 2 +- docs/validators/GreaterThanOrEqual.md | 2 +- docs/validators/LessThan.md | 2 +- docs/validators/LessThanOrEqual.md | 2 +- mkdocs.yml | 6 ++++++ src-dev/Commands/UpdateDocLinksCommand.php | 2 +- 21 files changed, 28 insertions(+), 13 deletions(-) rename docs/{08-comparable-values.md => comparable-values.md} (100%) rename docs/{06-concrete-api.md => concrete-api.md} (100%) rename docs/{07-custom-validators.md => custom-validators.md} (100%) rename docs/{02-feature-guide.md => feature-guide.md} (99%) rename docs/{03-handling-exceptions.md => handling-exceptions.md} (100%) rename docs/{01-installation.md => installation.md} (100%) rename docs/{10-license.md => license.md} (98%) rename docs/{09-list-of-validators-by-category.md => list-of-validators-by-category.md} (100%) rename docs/{05-message-placeholder-conversion.md => message-placeholder-conversion.md} (100%) rename docs/{04-message-translation.md => message-translation.md} (100%) diff --git a/README.md b/README.md index 05c4afe4..4ecee316 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ The most awesome validation engine ever created for PHP. - Complex validation made simple: `v::numericVal()->positive()->between(1, 255)->isValid($input)`. -- [Granularity control](docs/03-handling-exceptions.md) for advanced reporting. -- [More than 150](docs/09-list-of-validators-by-category.md) (fully tested) validators. -- [A concrete API](docs/06-concrete-api.md) for non fluent usage. +- [Granularity control](docs/handling-exceptions.md) for advanced reporting. +- [More than 150](docs/list-of-validators-by-category.md) (fully tested) validators. +- [A concrete API](docs/concrete-api.md) for non fluent usage. Learn More: diff --git a/docs/08-comparable-values.md b/docs/comparable-values.md similarity index 100% rename from docs/08-comparable-values.md rename to docs/comparable-values.md diff --git a/docs/06-concrete-api.md b/docs/concrete-api.md similarity index 100% rename from docs/06-concrete-api.md rename to docs/concrete-api.md diff --git a/docs/07-custom-validators.md b/docs/custom-validators.md similarity index 100% rename from docs/07-custom-validators.md rename to docs/custom-validators.md diff --git a/docs/02-feature-guide.md b/docs/feature-guide.md similarity index 99% rename from docs/02-feature-guide.md rename to docs/feature-guide.md index c6cbbe9d..3c762ac2 100644 --- a/docs/02-feature-guide.md +++ b/docs/feature-guide.md @@ -1,3 +1,7 @@ +--- +weight: -95 +--- + # Feature Guide The `ValidatorBuilder` class is the core of Respect\Validation, offering a fluent interface for building validators. diff --git a/docs/03-handling-exceptions.md b/docs/handling-exceptions.md similarity index 100% rename from docs/03-handling-exceptions.md rename to docs/handling-exceptions.md diff --git a/docs/index.md b/docs/index.md index b6602af5..1cb10ada 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,6 +3,6 @@ The most awesome validation engine ever created for PHP. - Complex validation made simple: `v::numericVal()->positive()->between(1, 255)->isValid($input)`. -- [Granularity control](03-handling-exceptions.md) for advanced reporting. -- [More than 150](09-list-of-validators-by-category.md) (fully tested) validators. -- [A concrete API](06-concrete-api.md) for non fluent usage. +- [Granularity control](handling-exceptions.md) for advanced reporting. +- [More than 150](list-of-validators-by-category.md) (fully tested) validators. +- [A concrete API](concrete-api.md) for non fluent usage. diff --git a/docs/01-installation.md b/docs/installation.md similarity index 100% rename from docs/01-installation.md rename to docs/installation.md diff --git a/docs/10-license.md b/docs/license.md similarity index 98% rename from docs/10-license.md rename to docs/license.md index 7583f187..a841269f 100644 --- a/docs/10-license.md +++ b/docs/license.md @@ -1,3 +1,7 @@ +--- +weight: -1 +--- + # License Copyright (c) [Alexandre Gomes Gaigalas](http://github.com/alganet). diff --git a/docs/09-list-of-validators-by-category.md b/docs/list-of-validators-by-category.md similarity index 100% rename from docs/09-list-of-validators-by-category.md rename to docs/list-of-validators-by-category.md diff --git a/docs/05-message-placeholder-conversion.md b/docs/message-placeholder-conversion.md similarity index 100% rename from docs/05-message-placeholder-conversion.md rename to docs/message-placeholder-conversion.md diff --git a/docs/04-message-translation.md b/docs/message-translation.md similarity index 100% rename from docs/04-message-translation.md rename to docs/message-translation.md diff --git a/docs/requirements.txt b/docs/requirements.txt index 2165e5c5..c0bf5f34 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ mkdocs>=1.5.0 pymdown-extensions>=10.0 +mkdocs-nav-weight==0.3.0 diff --git a/docs/validators/Between.md b/docs/validators/Between.md index ef7ef5b5..e6eb3af2 100644 --- a/docs/validators/Between.md +++ b/docs/validators/Between.md @@ -11,7 +11,7 @@ v::intVal()->between(10, 20)->isValid(20); // true ``` Validation makes comparison easier, check out our supported -[comparable values](../08-comparable-values.md). +[comparable values](../comparable-values.md). Message template for this validator includes `{{minValue}}` and `{{maxValue}}`. diff --git a/docs/validators/BetweenExclusive.md b/docs/validators/BetweenExclusive.md index 76ff1f41..f2deacc0 100644 --- a/docs/validators/BetweenExclusive.md +++ b/docs/validators/BetweenExclusive.md @@ -13,7 +13,7 @@ v::betweenExclusive(0, 100)->isValid(100); // false v::betweenExclusive('a', 'z')->isValid('a'); // false ``` -Validation makes comparison easier, check out our supported [comparable values](../08-comparable-values.md). +Validation makes comparison easier, check out our supported [comparable values](../comparable-values.md). ## Templates diff --git a/docs/validators/GreaterThan.md b/docs/validators/GreaterThan.md index 4102a431..89cae3dd 100644 --- a/docs/validators/GreaterThan.md +++ b/docs/validators/GreaterThan.md @@ -10,7 +10,7 @@ v::greaterThan(10)->isValid(9); // false ``` Validation makes comparison easier, check out our supported -[comparable values](../08-comparable-values.md). +[comparable values](../comparable-values.md). Message template for this validator includes `{{compareTo}}`. diff --git a/docs/validators/GreaterThanOrEqual.md b/docs/validators/GreaterThanOrEqual.md index 879728ad..efd1d17b 100644 --- a/docs/validators/GreaterThanOrEqual.md +++ b/docs/validators/GreaterThanOrEqual.md @@ -11,7 +11,7 @@ v::intVal()->greaterThanOrEqual(10)->isValid(11); // true ``` Validation makes comparison easier, check out our supported -[comparable values](../08-comparable-values.md). +[comparable values](../comparable-values.md). Message template for this validator includes `{{compareTo}}`. diff --git a/docs/validators/LessThan.md b/docs/validators/LessThan.md index c784fc44..3722338f 100644 --- a/docs/validators/LessThan.md +++ b/docs/validators/LessThan.md @@ -10,7 +10,7 @@ v::lessThan(10)->isValid(10); // false ``` Validation makes comparison easier, check out our supported -[comparable values](../08-comparable-values.md). +[comparable values](../comparable-values.md). Message template for this validator includes `{{compareTo}}`. diff --git a/docs/validators/LessThanOrEqual.md b/docs/validators/LessThanOrEqual.md index 905f9d30..610f5181 100644 --- a/docs/validators/LessThanOrEqual.md +++ b/docs/validators/LessThanOrEqual.md @@ -11,7 +11,7 @@ v::lessThanOrEqual(10)->isValid(11); // false ``` Validation makes comparison easier, check out our supported -[comparable values](../08-comparable-values.md). +[comparable values](../comparable-values.md). Message template for this validator includes `{{compareTo}}`. diff --git a/mkdocs.yml b/mkdocs.yml index 22dfb844..96caf248 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,12 @@ site_name: Respect\Validation theme: readthedocs +plugins: + - search + - mkdocs-nav-weight: + index_weight: -100 + default_page_weight: -50 + markdown_extensions: - pymdownx.highlight: anchor_linenums: true diff --git a/src-dev/Commands/UpdateDocLinksCommand.php b/src-dev/Commands/UpdateDocLinksCommand.php index 1aa0d80a..e56e34f7 100644 --- a/src-dev/Commands/UpdateDocLinksCommand.php +++ b/src-dev/Commands/UpdateDocLinksCommand.php @@ -168,7 +168,7 @@ final class UpdateDocLinksCommand extends Command $lines[] = sprintf('- [%1$s](validators/%1$s.md)', $validator); } - $outputFile = sprintf('%s/09-list-of-validators-by-category.md', $docsDirectory); + $outputFile = sprintf('%s/list-of-validators-by-category.md', $docsDirectory); file_put_contents($outputFile, trim(implode("\n", $lines)) . PHP_EOL); }