Skip to content

Commit

Permalink
Added Alerts docus
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHoegh committed Aug 26, 2024
1 parent 1b902c2 commit 3febbd5
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions versioned_docs/version-1.3.x/Configuration/Alerts.md
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.

0 comments on commit 3febbd5

Please sign in to comment.