Skip to content

Commit 17063f8

Browse files
committed
Changelog [ci skip]
1 parent a750efb commit 17063f8

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
## Unreleased
44

5+
## 0.5.0 - 2021-09-06
6+
7+
### Changed
8+
- Deprecated `\Torchlight\Commonmark\TorchlightExtension` in favor of the versioned `\Torchlight\Commonmark\V1\TorchlightExtension` and `\Torchlight\Commonmark\V2\TorchlightExtension` extensions
9+
510
### Added
6-
- You can now load files from markdown by using the `<<< file.php` convention.
11+
- You can now load files from markdown by using the `<<< path/to/file.php` convention.
12+
- Added support for CommonMark V2
713

814
## 0.4.1 - 2021-08-02
915

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22

33
[![Tests](https://github.com/torchlight-api/torchlight-commonmark-php/actions/workflows/tests.yml/badge.svg)](https://github.com/torchlight-api/torchlight-commonmark-php/actions/workflows/tests.yml) [![Latest Stable Version](https://poser.pugx.org/torchlight/torchlight-commonmark/v)](//packagist.org/packages/torchlight/torchlight-commonmark) [![Total Downloads](https://poser.pugx.org/torchlight/torchlight-commonmark/downloads)](//packagist.org/packages/torchlight/torchlight-commonmark) [![License](https://poser.pugx.org/torchlight/torchlight-commonmark/license)](//packagist.org/packages/torchlight/torchlight-commonmark)
44

5+
> 📚 The full docs can be found at [torchlight.dev/docs/clients/commonmark-php](https://torchlight.dev/docs/clients/commonmark-php).
56
67
A [Torchlight](https://torchlight.dev) syntax highlighting extension for the PHP League's [Commonmark Markdown Parser](https://commonmark.thephpleague.com/) in a Laravel application.
78

9+
Supports both CommonMark version 1 and version 2.
10+
811
Torchlight is a VS Code-compatible syntax highlighter that requires no JavaScript, supports every language, every VS Code theme, line highlighting, git diffing, and more.
912

1013
## Installation
1114

1215
To install, require the package from composer:
1316

14-
```
17+
```shell
1518
composer require torchlight/torchlight-commonmark
1619
```
1720

@@ -31,8 +34,14 @@ If you are using Graham Campbell's [Laravel Markdown](https://github.com/GrahamC
3134
If you aren't using the Laravel Markdown package, you can add the extension manually:
3235

3336
```php
37+
// CommonMark V1
3438
$environment = Environment::createCommonMarkEnvironment();
3539
$environment->addExtension(new TorchlightExtension);
40+
41+
// CommonMark V2
42+
$environment = new Environment();
43+
$environment->addExtension(new CommonMarkCoreExtension);
44+
$environment->addExtension(new TorchlightExtension);
3645
```
3746

3847
*That's all you need to do! All of your code fences will now be highlighted via Torchlight.*
@@ -41,7 +50,7 @@ $environment->addExtension(new TorchlightExtension);
4150

4251
Once the package is downloaded, you can run the following command to publish your configuration file:
4352

44-
```
53+
```shell
4554
php artisan torchlight:install
4655
```
4756

0 commit comments

Comments
 (0)