https://github.com/sixlive/parsedown-highlight
Extends Parsedown to add support for server side code block rendering
https://github.com/sixlive/parsedown-highlight
Last synced: about 1 year ago
JSON representation
Extends Parsedown to add support for server side code block rendering
- Host: GitHub
- URL: https://github.com/sixlive/parsedown-highlight
- Owner: sixlive
- License: mit
- Created: 2018-11-06T14:41:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T01:46:20.000Z (over 3 years ago)
- Last Synced: 2025-04-16T02:59:48.573Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 2.18 MB
- Stars: 23
- Watchers: 1
- Forks: 4
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Parsedown Highlight
## *NOTE: This requires v1.8 of Parsedown, which has not been released yet.*
[](https://packagist.org/packages/sixlive/parsedown-highlight)
[](https://packagist.org/packages/sixlive/parsedown-highlight)
[](https://travis-ci.org/sixlive/parsedown-highlight)
[](https://scrutinizer-ci.com/g/sixlive/parsedown-highlight/)
[](https://scrutinizer-ci.com/g/sixlive/parsedown-highlight/)
[](https://github.styleci.io/repos/156398051)
This extends Parsedown to add support for server side code block rendering. This uses [scrivo/highlight.php](https://github.com/scrivo/highlight.php) to do all the code block rendering. This will be fully compatible with Highlight JS.
## Installation
You can install the package via composer:
```bash
> composer require sixlive/parsedown-highlight
```
## Usage
```md
# Hello!
Here is a post with some code in it.
\```php
text(file_get_contents(__DIR__.'/README.md'));
```
```html
Hello!
Here is a post with some code in it.
<?php
echo 'foo';
put 'WHOOP!'
```
### Using Parsedown Extra
**Note: This requires version [0.8.0-beta-1](https://github.com/erusev/parsedown-extra/releases/tag/0.8.0-beta-1)**
```php
$parsedown = new \sixlive\ParsedownHighlightExtra;
$parsedown->text(file_get_contents(__DIR__.'/README.md'));
```
## Testing
``` bash
> composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Code Style
In addition to the php-cs-fixer rules, StyleCI will apply the [Laravel preset](https://docs.styleci.io/presets#laravel).
### Linting
```bash
> composer styles:lint
```
### Fixing
```bash
> composer styles:fix
```
## Security
If you discover any security related issues, please email oss@tjmiller.co instead of using the issue tracker.
## Credits
- [TJ Miller](https://github.com/sixlive)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.