Skip to content

Commit 748c86a

Browse files
committed
Added version 2.2.x
1 parent 04e2ed0 commit 748c86a

25 files changed

+1282
-1
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Abbreviations
3+
---
4+
5+
# Abbreviations
6+
7+
## Description
8+
9+
The Abbreviations feature provides automatic detection and formatting of abbreviations within your Markdown content. By wrapping abbreviations in `<abbr>` tags, it enhances text comprehension and accessibility, allowing users to see the full meaning of abbreviations on hover.
10+
11+
## Configuration Syntax
12+
13+
To configure the Abbreviations feature, use the `config()->set()` and `config()->get()` methods:
14+
15+
### Getting the Current Configuration
16+
17+
To retrieve the current configuration for the Abbreviations feature:
18+
19+
```php
20+
$configValue = config()->get('abbreviations');
21+
```
22+
23+
### Setting the Configuration
24+
25+
To adjust the Abbreviations feature, use:
26+
27+
```php
28+
config()->set('abbreviations', (bool|array) $value);
29+
```
30+
31+
- `$value` can be a boolean to enable or disable the feature globally, or an array for more detailed configuration options.
32+
33+
## Configuration Options
34+
35+
The Abbreviations feature supports the following settings:
36+
37+
- **allow_custom** (bool): Allows the definition of custom abbreviations directly within your Markdown content. This option is enabled by default.
38+
- **predefined** (array): Provides a list of predefined abbreviations and their full meanings to ensure consistency across your documents.
39+
40+
## Examples
41+
42+
### Disable Abbreviations
43+
44+
To completely disable the processing of abbreviations:
45+
46+
```php
47+
$ParsedownExtended->config()->set('abbreviations', false);
48+
```
49+
50+
### Predefine Abbreviations
51+
52+
To set up a predefined list of abbreviations:
53+
54+
```php
55+
$ParsedownExtended->config()->set('abbreviations', [
56+
'predefined' => [
57+
'CSS' => 'Cascading Style Sheets',
58+
'HTML' => 'HyperText Markup Language',
59+
'JS' => 'JavaScript',
60+
],
61+
]);
62+
```
63+
64+
### Use Predefined Abbreviations Only
65+
66+
To restrict usage to only predefined abbreviations and disable custom abbreviations:
67+
68+
```php
69+
$ParsedownExtended->config()->set('abbreviations', [
70+
'allow_custom' => false,
71+
'predefined' => [
72+
'CSS' => 'Cascading Style Sheets',
73+
'HTML' => 'HyperText Markup Language',
74+
'JS' => 'JavaScript',
75+
],
76+
]);
77+
```
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Alerts
3+
---
4+
5+
# Alerts
6+
7+
## Description
8+
9+
ParsedownExtended supports GitHub Flavored Markdown (GFM) alert syntax. Alerts are block-quote-style callouts that are styled with a distinctive type label, making it easy to draw attention to notes, tips, warnings, and other important information.
10+
11+
```markdown
12+
> [!NOTE]
13+
> Highlights information that users should take into account.
14+
> [!TIP]
15+
> Optional information to help a user be more successful.
16+
> [!IMPORTANT]
17+
> Crucial information necessary for users to succeed.
18+
> [!WARNING]
19+
> Critical content demanding immediate user attention due to potential risks.
20+
> [!CAUTION]
21+
> Negative potential consequences of an action.
22+
```
23+
24+
Each alert type is wrapped in a `<div>` with a CSS class composed of the base class and the lowercase alert type, e.g., `markdown-alert markdown-alert-note`.
25+
26+
## Configuration Syntax
27+
28+
To configure Alerts in ParsedownExtended, use the `config()->set()` method:
29+
30+
```php
31+
$ParsedownExtended->config()->set('alerts', (bool|array) $value);
32+
```
33+
34+
## Parameters
35+
36+
- **types** (array): The list of recognised alert type labels (case-insensitive). Defaults to `['note', 'tip', 'important', 'warning', 'caution']`.
37+
- **class** (string): The base CSS class applied to the outer `<div>` wrapper of every alert. Defaults to `'markdown-alert'`.
38+
39+
## Examples
40+
41+
### Disable Alerts
42+
43+
To disable alert block processing entirely:
44+
45+
```php
46+
$ParsedownExtended->config()->set('alerts', false);
47+
```
48+
49+
### Custom Alert Types
50+
51+
To support only a subset of alert types, or to add your own:
52+
53+
```php
54+
$ParsedownExtended->config()->set('alerts.types', ['note', 'warning', 'danger']);
55+
```
56+
57+
### Custom CSS Class
58+
59+
To use a different base CSS class for styling:
60+
61+
```php
62+
$ParsedownExtended->config()->set('alerts.class', 'callout');
63+
```
64+
65+
With this setting a `> [!NOTE]` block would render as:
66+
```html
67+
<div class="callout callout-note">
68+
<p>...</p>
69+
</div>
70+
```
71+
72+
### Localised Alert Labels
73+
74+
You can replace the default English type labels with your own language or branding:
75+
76+
```php
77+
$ParsedownExtended->config()->set('alerts.types', ['hinweis', 'tipp', 'warnung']);
78+
```
79+
80+
Then use the matching labels in your Markdown:
81+
82+
```markdown
83+
> [!HINWEIS]
84+
> This is a note in German.
85+
```
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Code
3+
---
4+
5+
# Code
6+
7+
## Description
8+
9+
Code snippets within Markdown documents can be presented in two distinct styles: inline and block. Inline code is used for highlighting code or commands within a sentence, whereas block code is suited for larger code excerpts or examples that should stand apart from the main text. ParsedownExtended enhances the management of both inline and block code snippets, offering configurable settings to fine-tune their processing and presentation.
10+
11+
## Configuration Syntax
12+
13+
To configure the code processing settings, use the `config()->set()` and `config()->get()` methods:
14+
15+
### Getting the Current Configuration
16+
17+
To retrieve the current configuration for code processing:
18+
19+
```php
20+
$configValue = $ParsedownExtended->config()->get('code');
21+
```
22+
23+
### Setting the Configuration
24+
25+
To adjust the code processing settings:
26+
27+
```php
28+
$ParsedownExtended->config()->set('code', (bool|array) $value);
29+
```
30+
31+
- `$value` is a boolean indicating whether inline code processing is enabled (`true`) or disabled (`false`). Alternatively, you can use an array for more detailed configuration options. By default, inline code formatting is usually enabled.
32+
33+
## Examples
34+
35+
### Disabling All Code Processing
36+
37+
To disable the processing of all code, including both inline and block code:
38+
39+
```php
40+
$ParsedownExtended->config()->set('code', false);
41+
```
42+
43+
### Disabling Inline Code
44+
45+
To disable the formatting of inline code, preventing text surrounded by backticks from being rendered distinctly:
46+
47+
```php
48+
$ParsedownExtended->config()->set('code.inline', false);
49+
```
50+
51+
### Disabling Block Code
52+
53+
To disable the processing of block code, which is usually delimited by triple backticks or indentation:
54+
55+
```php
56+
$ParsedownExtended->config()->set('code.block', false);
57+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Comments
3+
---
4+
5+
# Comments
6+
7+
## Description
8+
9+
The Comments feature in Markdown allows you to include notes or annotations within your content that won't be rendered in the final output. This is useful for adding explanations or reminders that are visible in the source but invisible to the end user. ParsedownExtended provides options to enable or disable the processing of comments within your Markdown files.
10+
11+
## Configuration Syntax
12+
13+
To configure the Comments feature, use the `config()->set()` and `config()->get()` methods:
14+
15+
### Getting the Current Configuration
16+
17+
To retrieve the current configuration for comment processing:
18+
19+
```php
20+
$configValue = $ParsedownExtended->config()->get('comments');
21+
```
22+
23+
### Setting the Configuration
24+
25+
To adjust the Comments feature:
26+
27+
```php
28+
$ParsedownExtended->config()->set('comments', (bool) $value);
29+
```
30+
31+
- `$value` is a boolean indicating whether comment processing is enabled (`true`) or disabled (`false`). By default, comment processing may be enabled or disabled based on your system's settings.
32+
33+
## Examples
34+
35+
### Disabling Comments
36+
37+
To disable the processing of comments in Markdown, preventing any comments from being included in the source:
38+
39+
```php
40+
$ParsedownExtended->config()->set('comments', false);
41+
```
42+
43+
### Enabling Comments
44+
45+
To enable the processing of comments, allowing annotations to be included in your Markdown files but not rendered in the final output:
46+
47+
```php
48+
$ParsedownExtended->config()->set('comments', true);
49+
```
50+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Definition Lists
3+
---
4+
5+
# Definition Lists
6+
7+
## Description
8+
9+
Definition lists allow for the organization of terms and their corresponding definitions in a structured format. This functionality enables authors to create glossaries or specify key concepts with descriptions directly within their Markdown content. While the capability to interpret definition list syntax comes from Parsedown, ParsedownExtended provides enhanced support by allowing users to easily enable or disable this feature through its configuration settings.
10+
11+
## Configuration Syntax
12+
13+
To configure the processing of definition lists in your Markdown, use the `config()->set()` and `config()->get()` methods:
14+
15+
### Getting the Current Configuration
16+
17+
To retrieve the current configuration for definition list processing:
18+
19+
```php
20+
$configValue = $ParsedownExtended->config()->get('definition_lists');
21+
```
22+
23+
### Setting the Configuration
24+
25+
To adjust the processing of definition lists:
26+
27+
```php
28+
$ParsedownExtended->config()->set('definition_lists', (bool) $value);
29+
```
30+
31+
- `$value` is a boolean indicating whether definition lists should be processed (`true`) or ignored (`false`).
32+
33+
## Examples
34+
35+
### Disable Definition Lists
36+
37+
To prevent the automatic processing of definition lists, thereby disabling the feature:
38+
39+
```php
40+
$ParsedownExtended->config()->set('definition_lists', false);
41+
```
42+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Diagrams
3+
---
4+
5+
# Diagrams
6+
7+
## Description
8+
9+
ParsedownExtended introduces support for incorporating diagrams directly into Markdown documents, enhancing visual representation and understanding. This feature recognizes syntax intended for diagram rendering, specifically designed to work with [ChartJS](https://www.chartjs.org) and [Mermaid](https://mermaid-js.github.io/mermaid/). ParsedownExtended ensures that diagram code is preserved and remains unaltered for client-side rendering, requiring the inclusion of ChartJS and Mermaid JavaScript libraries in your project.
10+
11+
```mermaid
12+
graph TD;
13+
A-->B;
14+
A-->C;
15+
B-->D;
16+
C-->D;
17+
```
18+
19+
## Configuration Syntax
20+
21+
To enable the diagrams feature in ParsedownExtended, use the `config()->set()` and `config()->get()` methods:
22+
23+
### Getting the Current Configuration
24+
25+
To retrieve the current configuration for diagram support:
26+
27+
```php
28+
$configValue = $ParsedownExtended->config()->get('diagrams');
29+
```
30+
31+
### Setting the Configuration
32+
33+
To adjust the diagram processing settings:
34+
35+
```php
36+
$ParsedownExtended->config()->set('diagrams', (bool|array) $value);
37+
```
38+
39+
- `$value` can be a boolean to enable or disable diagram support globally, or an array for more specific configuration options.
40+
41+
## Configuration Options
42+
43+
This feature allows the following settings:
44+
45+
- **chartjs**: Enable or disable support for ChartJS diagrams.
46+
- **mermaid**: Enable or disable support for Mermaid diagrams.
47+
48+
## Examples
49+
50+
### Enable Diagrams
51+
52+
To activate diagram support, ensuring that Markdown containing ChartJS or Mermaid syntax is properly recognized and left intact for client-side rendering:
53+
54+
```php
55+
$ParsedownExtended->config()->set('diagrams', true);
56+
```
57+
58+
### Disable a Specific Diagram Type
59+
60+
To disable support for a specific diagram type, such as ChartJS:
61+
62+
```php
63+
$ParsedownExtended->config()->set('diagrams', [
64+
'chartjs' => false
65+
]);
66+
```
67+

0 commit comments

Comments
 (0)