Skip to content
Extends Parsedown to add support for server side code block rendering
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
bin
examples/jigsaw
src
tests
.editorconfig
.gitattributes
.gitignore
.php_cs
.scrutinizer.yml
.styleci.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

Parsedown Highlight

NOTE: This requires v1.8 of Parsedown, which has not been released yet.

Packagist Version Packagist Downloads Travis Code Quality Code Coverage StyleCI

This extends Parsedown to add support for server side code block rendering. This uses 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:

> composer require sixlive/parsedown-highlight

Usage

# Hello!

Here is a post with some code in it.

\```php
<?php

echo 'foo';
\```

\```asldfh
put 'WHOOP!'
\```
$parsedown = new \sixlive\ParsedownHighlight;

$parsedown->text(file_get_contents(__DIR__.'/README.md'));
<h1>Hello!</h1>
<p>Here is a post with some code in it.</p>
<pre><code class="language-php hljs php"><span class="hljs-meta">&lt;?php</span>

<span class="hljs-keyword">echo</span> <span class="hljs-string">'foo'</span>;</code></pre>
<pre><code class="language-asldfh">put 'WHOOP!'</code></pre>

Testing

> composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Code Style

In addition to the php-cs-fixer rules, StyleCI will apply the Laravel preset.

Linting

> composer styles:lint

Fixing

> composer styles:fix

Security

If you discover any security related issues, please email oss@tjmiller.co instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.