Skip to content

Commit

Permalink
Merge pull request #64 from froschdesign/hotfix/docs/admonition
Browse files Browse the repository at this point in the history
Rewrites blockquotes to admonitions / call-outs
  • Loading branch information
froschdesign authored Nov 26, 2021
2 parents 9fe2242 + e92ad33 commit 8c46998
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 85 deletions.
8 changes: 2 additions & 6 deletions docs/book/filters/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ normalizing data and files:
The concept and the basic usage of the filters can be found in the
[documentation of laminas-filter](https://docs.laminas.dev/laminas-filter/).

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation requirements
>
> The filtering support of laminas-i18n depends on the
> [laminas-filter](https://docs.laminas.dev/laminas-filter/) component, so be
> sure to have it installed before getting started:
> MISSING: **Installation Requirements**
> The filtering support of laminas-i18n depends on the [laminas-filter](https://docs.laminas.dev/laminas-filter/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-filter
Expand Down
18 changes: 5 additions & 13 deletions docs/book/filters/number-parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ e.g. `en_US` or `de_DE`).
```
<!-- markdownlint-restore -->

> ### Notice
>
> After the first filtering, the locale changes will have no effect anymore.
> Create a new instance of the filter to change the locale.
NOTE: After the first filtering, the locale changes will have no effect anymore.
Create a new instance of the filter to change the locale.

### Get Current Value

Expand Down Expand Up @@ -103,10 +101,8 @@ This option sets the style of the parsing; one of the
```
<!-- markdownlint-restore -->

> ### Notice
>
> After the first filtering, the style changes will have no effect anymore.
> Create a new instance of the filter to change the style.
NOTE: After the first filtering, the style changes will have no effect anymore.
Create a new instance of the filter to change the style.

### Get Current Value

Expand Down Expand Up @@ -171,11 +167,7 @@ $filter = new Laminas\I18n\Filter\NumberParse();
$filter->setFormatter($formatter);
```

> ### Notice
>
> If a custom formatter is set, the locale and/or the style changes will
> have no effect anymore. Set a new number formatter to change the locale and/or
> the style.
NOTE: If a custom formatter is set, the locale and/or the style changes will have no effect anymore. Set a new number formatter to change the locale and/or the style.

### Get Current Value

Expand Down
7 changes: 2 additions & 5 deletions docs/book/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ The translator itself is initialized without any parameters, as any
configuration to it is optional. A translator without any translations will do
nothing but return all messages verbatim.

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation Requirements
>
> MISSING: **Installation Requirements**
> The translation support of laminas-i18n depends on the [laminas-servicemanager](https://docs.laminas.dev/laminas-servicemanager/) component, so be sure to have it installed before getting started:
>
> ```bash
Expand Down Expand Up @@ -83,8 +81,7 @@ Additionally, you can use custom formats by implementing one or more of
`Laminas\I18n\Translator\Loader\RemoteLoaderInterface`, and registering your loader
with the `Translator` instance's composed plugin manager.

> ### Installation Requirements
>
> MISSING: **Installation Requirements**
> The support of the INI translation format depends on the [laminas-config](https://docs.laminas.dev/laminas-config/) component, so be sure to have it installed before getting started:
>
> ```bash
Expand Down
8 changes: 2 additions & 6 deletions docs/book/translator/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ In production, it makes sense to cache your translations. This not only saves
you from loading and parsing the individual formats each time, but also
guarantees an optimized loading procedure.

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation requirements
>
> The cache support of laminas-i18n depends on the
> [laminas-cache](https://docs.laminas.dev/laminas-cache/) component, so be sure
> to have it installed before getting started:
> MISSING: **Installation Requirements**
> The cache support of laminas-i18n depends on the [laminas-cache](https://docs.laminas.dev/laminas-cache/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-cache
Expand Down
22 changes: 6 additions & 16 deletions docs/book/translator/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ translations:
The typical usage for these events is to log missing translations and track when
the loading of messages fails.

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation requirements
>
> The event support of laminas-i18n depends on the
> [laminas-eventmanager](https://docs.laminas.dev/laminas-eventmanager/)
> component, so be sure to have it installed before getting started:
> MISSING: **Installation Requirements**
> The event support of laminas-i18n depends on the [laminas-eventmanager](https://docs.laminas.dev/laminas-eventmanager/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-eventmanager
Expand Down Expand Up @@ -88,11 +84,8 @@ The default value of this option is `false`.
$eventManager = $translator->getEventManager(); // instance of Laminas\EventManager\EventManager
```

> ### Automatic instantiation
>
> The translator can create an event manager instance independently. If no custom
> event manager is set for the translator, the `getEventManager()` method
> returns this instance.
INFO: **Automatic Instantiation**
The translator can create an event manager instance independently. If no custom event manager is set for the translator, the `getEventManager()` method returns this instance.

#### Default Value

Expand Down Expand Up @@ -153,11 +146,8 @@ $params = $event->getParams(); // ['locale' => '…', 'text_domain' => '…']

## Example

> ### Installation requirements
>
> The following examples depends on the
> [laminas-log](https://docs.laminas.dev/laminas-log/)
> component, so be sure to have it installed before getting started:
> MISSING: **Installation Requirements**
> The following examples depends on the [laminas-log](https://docs.laminas.dev/laminas-log/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-log
Expand Down
8 changes: 2 additions & 6 deletions docs/book/validators/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ and files: [laminas-validator](https://docs.laminas.dev/laminas-validator/).
The documentation of laminas-validator also describes the
[translate of the validation messages](https://docs.laminas.dev/laminas-validator/intro/#translating-messages).

<!-- markdownlint-disable-next-line MD001-->
> ### Installation requirements
>
> The validation support of laminas-i18n depends on the
> [laminas-validator](https://docs.laminas.dev/laminas-validator/) component, so
> be sure to have it installed before getting started:
> MISSING: **Installation Requirements**
> The validation support of laminas-i18n depends on the [laminas-validator](https://docs.laminas.dev/laminas-validator/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-validator
Expand Down
10 changes: 3 additions & 7 deletions docs/book/validators/phone-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,9 @@ Possible values for allowed patterns are:
- `voicemail`
- `voip`

> ### All allowed patterns
>
> The complete list of allowed patterns is not available for each country code.
> Please check the file for your country code with the supported types in the
> [laminas-i18n repository on GitHub](https://github.com/laminas/laminas-i18n/tree/master/src/Validator/PhoneNumber)
> or in the `vendor/laminas/laminas-i18n/src/Validator/PhoneNumber` directory
> of your project folder.
NOTE: **All Allowed Patterns**
The complete list of allowed patterns is not available for each country code.
Please check the file for your country code with the supported types in the [laminas-i18n repository on GitHub](https://github.com/laminas/laminas-i18n/tree/master/src/Validator/PhoneNumber) or in the `vendor/laminas/laminas-i18n/src/Validator/PhoneNumber` directory of your project folder.

### Get Current Value

Expand Down
32 changes: 11 additions & 21 deletions docs/book/view-helpers/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,33 @@ These helpers are based on Laminas component for the view layer:
[laminas-view](https://docs.laminas.dev/laminas-view/) and their
[helpers](https://docs.laminas.dev/laminas-view/helpers/intro/).

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation Requirements
>
> The view-helper support of laminas-i18n depends on the
> [laminas-view](https://docs.laminas.dev/laminas-view/) component, so be sure
> to have it installed before getting started:
> MISSING: **Installation Requirements**
> The view-helper support of laminas-i18n depends on the [laminas-view](https://docs.laminas.dev/laminas-view/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-view
> ```
---
> ### IDE auto-completion in templates
>
> The `Laminas\I18n\View\HelperTrait` trait can be used to provide
> auto-completion for modern IDEs. It defines the aliases of the view helpers in
> a DocBlock as `@method` tags.
<!-- markdownlint-disable MD001 -->
> TIP: **IDE Auto-Completion in Templates**
> The `Laminas\I18n\View\HelperTrait` trait can be used to provide auto-completion for modern IDEs. It defines the aliases of the view helpers in a DocBlock as `@method` tags.
>
> #### Usage
> ### Usage
>
> In order to allow auto-completion in templates, `$this` variable should be
> type-hinted via a DocBlock at the top of a template. It is recommended that
> always the `Laminas\View\Renderer\PhpRenderer` is added as the first type, so
> that the IDE can auto-suggest the default view helpers from `laminas-view`.
> The `HelperTrait` from `laminas-i18n` can be chained with a pipe symbol
> (a.k.a. vertical bar) `|`:
> In order to allow auto-completion in templates, `$this` variable should be type-hinted via a DocBlock at the top of a template.
> It is recommended that> always the `Laminas\View\Renderer\PhpRenderer` is added as the first type, so that the IDE can auto-suggest the default view helpers from `laminas-view`.
> The `HelperTrait` from `laminas-i18n` can be chained with a pipe symbol (a.k.a. vertical bar) `|`:
>
> ```php
> /**
> * @var Laminas\View\Renderer\PhpRenderer|Laminas\I18n\View\HelperTrait $this
> */
> ```
>
> The `HelperTrait` traits can be chained as many as needed, depending on which
> view helpers from the different Laminas component are used and where the
> auto-completion is to be made.
> The `HelperTrait` traits can be chained as many as needed, depending on which view helpers from the different Laminas component are used and where the auto-completion is to be made.
<!-- markdownlint-restore -->
## Abstract Translator Helper
Expand Down
7 changes: 2 additions & 5 deletions docs/book/view-helpers/plural.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ and "1 voiture") and the plural form otherwise ("3 voitures").
Therefore we often need to handle plural cases even without translation
(mono-lingual application). The `Plural` helper was created for this.

<!-- markdownlint-disable-next-line MD001-->
> ### Plural Helper does not translate
>
> If you need to handle both plural cases *and* translations, you must use the
> [`TranslatePlural` helper](translate-plural.md); `Plural` does not translate.
WARNING: **Plural Helper Does Not Translate**
If you need to handle both plural cases *and* translations, you must use the [`TranslatePlural` helper](translate-plural.md); `Plural` does not translate.

Internally, the `Plural` helper uses the `Laminas\I18n\Translator\Plural\Rule` class to handle rules.

Expand Down

0 comments on commit 8c46998

Please sign in to comment.