-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b902c2
commit 3febbd5
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Alerts | ||
--- | ||
|
||
# Alerts | ||
|
||
## Description | ||
|
||
Alerts in Markdown provide a way to emphasize important information, such as tips, warnings, or critical notes. ParsedownExtended enhances Markdown with a customizable alerts feature that allows you to easily integrate these types of messages into your documents. The alert types are configurable, allowing you to define the specific categories of alerts that suit your content needs. | ||
|
||
## Configuration Syntax | ||
|
||
Configure alert processing in ParsedownExtended using the `config()->set()` method: | ||
|
||
```php | ||
$ParsedownExtended->config()->set('alerts', (bool|array) $value); | ||
``` | ||
|
||
This setting can be a simple boolean to enable or disable all alerts, or an array to manage specific alert behaviors with greater precision. | ||
|
||
## Parameters | ||
|
||
- **enabled** (boolean): Determines whether alerts are enabled in your Markdown documents. Enabled by default. | ||
- **types** (array): Specifies the types of alerts available. The default types are `note`, `tip`, `important`, `warning`, and `caution`. | ||
|
||
## Examples | ||
|
||
### Enable GFM Alerts | ||
|
||
To disable all alert processing in your Markdown: | ||
|
||
```php | ||
$ParsedownExtended->config()->set('alerts', false); | ||
``` | ||
|
||
### Customize Alert Types | ||
|
||
To customize the types of alerts available in your Markdown: | ||
|
||
```php | ||
$ParsedownExtended->config()->set('alerts', [ | ||
'types' => ['note', 'warning', 'custom-type'] | ||
]); | ||
``` | ||
|
||
In this example, only `note`, `warning`, and a custom alert type `custom-type` will be recognized and rendered as alerts. |