Skip to content

Commit

Permalink
Fix broken documentation links
Browse files Browse the repository at this point in the history
Signed-off-by: Henrique Moody <[email protected]>
  • Loading branch information
henriquemoody committed Feb 19, 2024
1 parent d8cd6a3 commit 543b973
Show file tree
Hide file tree
Showing 25 changed files with 57 additions and 28 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
The most awesome validation engine ever created for PHP.

- Complex rules made simple: `v::numericVal()->positive()->between(1, 255)->validate($input)`.
- [Granularity control](docs/feature-guide.md#validation-methods) for advanced reporting.
- [More than 150](docs/list-of-rules.md) (fully tested) validation rules.
- [A concrete API](docs/concrete-api.md) for non fluent usage.
- [Granularity control](docs/02-feature-guide.md#validation-methods) for advanced reporting.
- [More than 150](docs/08-list-of-rules-by-category.md) (fully tested) validation rules.
- [A concrete API](docs/05-concrete-api.md) for non fluent usage.

Learn More:

Expand Down
12 changes: 6 additions & 6 deletions bin/update-doc-links
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ create_rule_documentation()
local rule=${1}
local related_rules=${2}
local filename="${DOCS_DIREECTORY}/rules/${rule}.md"
local links=$(egrep '^\[.+\]: .+' "${filename}")
local links=$(ggrep -E '^\[.+\]: .+' "${filename}")
local related_links=$(
tr ':' '\n' <<< ${related_rules} |
sort -u |
Expand All @@ -46,10 +46,10 @@ create_rule_documentation()
)

# "Description" section
sed -nE '/^# /,/^## Changelog/p' "${filename}" | egrep -v '^## Changelog'
sed -nE '/^# /,/^## Changelog/p' "${filename}" | ggrep -E -v '^## Changelog'

# "Changelog" section
sed -nE '/^## Changelog/,/^\*\*\*/p' "${filename}" | fgrep -v '***'
sed -nE '/^## Changelog/,/^\*\*\*/p' "${filename}" | ggrep -Fv '***'

# "See also" section
echo "***"
Expand Down Expand Up @@ -78,7 +78,7 @@ create_list_of_rules()

echo "Creating list of rules"
{
echo "# List of rules"
echo "# List of rules by category"
echo
for category in $(list_categories); do
echo "## ${category}"
Expand All @@ -91,7 +91,7 @@ create_list_of_rules()
echo "## Alphabetically"
echo
ls -1 "${DOCS_DIREECTORY}/rules/" | sort | sed -E 's,^(.+).md$,- [\1](rules/\1.md),'
} > "${DOCS_DIREECTORY}/list-of-rules.md"
} > "${DOCS_DIREECTORY}/08-list-of-rules-by-category.md"
}

link_related_rules()
Expand All @@ -101,7 +101,7 @@ link_related_rules()
echo "Building list of related rules"
for rule in $(list_rules); do
declare filename="${DOCS_DIREECTORY}/rules/${rule}.md"
declare related_rules=$(egrep '\[.+\]\(.+\.md\)' "${filename}" |
declare related_rules=$(ggrep -E '\[.+\]\(.+\.md\)' "${filename}" |
sed -E 's,.*\[.+\]\((.+)\.md\).*,\1,' |
grep -v 'comparable-values')

Expand Down
9 changes: 4 additions & 5 deletions docs/08-list-of-rules-by-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,14 @@
- [Pesel](rules/Pesel.md)
- [Pis](rules/Pis.md)
- [PolishIdCard](rules/PolishIdCard.md)

## Integrations

- [Sf](rules/Sf.md)
- [PortugueseNif](rules/PortugueseNif.md)

## Internet

- [Domain](rules/Domain.md)
- [Email](rules/Email.md)
- [Ip](rules/Ip.md)
- [PublicDomainSuffix](rules/PublicDomainSuffix.md)
- [Tld](rules/Tld.md)
- [Url](rules/Url.md)
- [VideoUrl](rules/VideoUrl.md)
Expand Down Expand Up @@ -382,17 +380,18 @@
- [PhpLabel](rules/PhpLabel.md)
- [Pis](rules/Pis.md)
- [PolishIdCard](rules/PolishIdCard.md)
- [PortugueseNif](rules/PortugueseNif.md)
- [Positive](rules/Positive.md)
- [PostalCode](rules/PostalCode.md)
- [PrimeNumber](rules/PrimeNumber.md)
- [Printable](rules/Printable.md)
- [PublicDomainSuffix](rules/PublicDomainSuffix.md)
- [Punct](rules/Punct.md)
- [Readable](rules/Readable.md)
- [Regex](rules/Regex.md)
- [ResourceType](rules/ResourceType.md)
- [Roman](rules/Roman.md)
- [ScalarVal](rules/ScalarVal.md)
- [Sf](rules/Sf.md)
- [Size](rules/Size.md)
- [Slug](rules/Slug.md)
- [Sorted](rules/Sorted.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
The most awesome validation engine ever created for PHP.

- Complex rules made simple: `v::numericVal()->positive()->between(1, 255)->validate($input)`.
- [Granularity control](feature-guide.md#validation-methods) for advanced reporting.
- [More than 150](list-of-rules.md) (fully tested) validation rules.
- [A concrete API](concrete-api.md) for non fluent usage.
- [Granularity control](02-feature-guide.md#validation-methods) for advanced reporting.
- [More than 150](08-list-of-rules-by-category.md) (fully tested) validation rules.
- [A concrete API](05-concrete-api.md) for non fluent usage.
2 changes: 1 addition & 1 deletion docs/rules/Between.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ v::intVal()->between(10, 20)->validate(20); // true
```

Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
[comparable values](../07-comparable-values.md).

Message template for this validator includes `{{minValue}}` and `{{maxValue}}`.

Expand Down
1 change: 1 addition & 0 deletions docs/rules/Bsn.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ See also:
- [Cpf](Cpf.md)
- [Imei](Imei.md)
- [Nif](Nif.md)
- [PortugueseNif](PortugueseNif.md)
1 change: 1 addition & 0 deletions docs/rules/Callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ See also:

- [Call](Call.md)
- [CallableType](CallableType.md)
- [DateTime](DateTime.md)
- [FilterVar](FilterVar.md)
1 change: 1 addition & 0 deletions docs/rules/Cnh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ See also:
- [NfeAccessKey](NfeAccessKey.md)
- [Nif](Nif.md)
- [Pis](Pis.md)
- [PortugueseNif](PortugueseNif.md)
1 change: 1 addition & 0 deletions docs/rules/Cnpj.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ See also:
- [NfeAccessKey](NfeAccessKey.md)
- [Nif](Nif.md)
- [Pis](Pis.md)
- [PortugueseNif](PortugueseNif.md)
1 change: 1 addition & 0 deletions docs/rules/CountryCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ See also:
- [CurrencyCode](CurrencyCode.md)
- [LanguageCode](LanguageCode.md)
- [PostalCode](PostalCode.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [SubdivisionCode](SubdivisionCode.md)
- [Tld](Tld.md)

Expand Down
1 change: 1 addition & 0 deletions docs/rules/Cpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ See also:
- [NfeAccessKey](NfeAccessKey.md)
- [Nif](Nif.md)
- [Pis](Pis.md)
- [PortugueseNif](PortugueseNif.md)
9 changes: 9 additions & 0 deletions docs/rules/CreditCard.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ See also:
- [Luhn](Luhn.md)
- [NoWhitespace](NoWhitespace.md)
- [Regex](Regex.md)
***
See also:

- [Decimal](Decimal.md)
- [Digit](Digit.md)
- [Iban](Iban.md)
- [Luhn](Luhn.md)
- [NoWhitespace](NoWhitespace.md)
- [Regex](Regex.md)
2 changes: 1 addition & 1 deletion docs/rules/DateTime.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# DateTime

- `DateTime()`
Expand Down Expand Up @@ -72,6 +71,7 @@ v::dateTime(DateTime::RFC3339_EXTENDED)->validate($input); // false
See also:

- [Between](Between.md)
- [Callback](Callback.md)
- [Date](Date.md)
- [LeapDate](LeapDate.md)
- [LeapYear](LeapYear.md)
Expand Down
1 change: 1 addition & 0 deletions docs/rules/Domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ See also:
- [Ip](Ip.md)
- [Json](Json.md)
- [MacAddress](MacAddress.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [Tld](Tld.md)
- [Url](Url.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/GreaterThan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ v::greaterThan(10)->validate(9); // false
```

Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
[comparable values](../07-comparable-values.md).

Message template for this validator includes `{{compareTo}}`.

Expand Down
1 change: 1 addition & 0 deletions docs/rules/Ip.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ See also:

- [Domain](Domain.md)
- [MacAddress](MacAddress.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [Tld](Tld.md)

[filter_var()]: https://php.net/filter_var
2 changes: 1 addition & 1 deletion docs/rules/LessThan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ v::lessThan(10)->validate(10); // false
```

Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
[comparable values](../07-comparable-values.md).

Message template for this validator includes `{{compareTo}}`.

Expand Down
1 change: 1 addition & 0 deletions docs/rules/MacAddress.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ See also:
- [Domain](Domain.md)
- [Iban](Iban.md)
- [Ip](Ip.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [Tld](Tld.md)
2 changes: 1 addition & 1 deletion docs/rules/Max.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ v::max(10)->validate(11); // false
```

Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
[comparable values](../07-comparable-values.md).

Message template for this validator includes `{{compareTo}}`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/Min.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ v::intVal()->min(10)->validate(11); // true
```

Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
[comparable values](../07-comparable-values.md).

Message template for this validator includes `{{compareTo}}`.

Expand Down
3 changes: 2 additions & 1 deletion docs/rules/Nif.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ v::nif()->validate('P6437358A'); // false

Version | Description
--------|-------------
2.0.0 | Created
2.2.0 | Created

***
See also:
Expand All @@ -26,3 +26,4 @@ See also:
- [Cnh](Cnh.md)
- [Cnpj](Cnpj.md)
- [Cpf](Cpf.md)
- [PortugueseNif](PortugueseNif.md)
14 changes: 12 additions & 2 deletions docs/rules/PortugueseNif.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Portuguese NIF
# PortugueseNif

- `PortugueseNif()`

Expand All @@ -13,7 +13,17 @@ v::portugueseNif()->validate('220005245'); // false

- Identifications

## Changelog

| Version | Description |
| ------: | ----------- |
| 2.2.0 | Created |

***
See also:

- [Nif](Nif.md)
- [Bsn](Bsn.md)
- [Cnh](Cnh.md)
- [Cnpj](Cnpj.md)
- [Cpf](Cpf.md)
- [Nif](Nif.md)
2 changes: 1 addition & 1 deletion docs/rules/PublicDomainSuffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Version | Description
***
See also:

- [Tld](Tld.md)
- [CountryCode](CountryCode.md)
- [Domain](Domain.md)
- [Ip](Ip.md)
- [MacAddress](MacAddress.md)
- [SubdivisionCode](SubdivisionCode.md)
- [Tld](Tld.md)
1 change: 1 addition & 0 deletions docs/rules/SubdivisionCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ See also:
- [Nip](Nip.md)
- [Pesel](Pesel.md)
- [PolishIdCard](PolishIdCard.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [Tld](Tld.md)

[iso-codes]: https://salsa.debian.org/iso-codes-team/iso-codes
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/Tld.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ See also:
- [Domain](Domain.md)
- [Ip](Ip.md)
- [MacAddress](MacAddress.md)
- [SubdivisionCode](SubdivisionCode.md)
- [PublicDomainSuffix](PublicDomainSuffix.md)
- [SubdivisionCode](SubdivisionCode.md)

0 comments on commit 543b973

Please sign in to comment.