sixlive / parsedown-highlight
Server side code block rendering for Parsedown
Installs: 274
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 2
Forks: 4
Open Issues: 20
Requires
- php: ^7.1|7.2
- erusev/parsedown: 1.8.0-beta-5
- erusev/parsedown-extra: 0.8.0-beta-1
- scrivo/highlight.php: ^9.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.10
- larapack/dd: ^1.0
- phpunit/phpunit: ^6.0|^7.0
- sempro/phpunit-pretty-print: ^1.0
- dev-master
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
- dev-dependabot/npm_and_yarn/examples/jigsaw/express-4.18.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/examples/jigsaw/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/examples/jigsaw/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/examples/jigsaw/tar-2.2.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/examples/jigsaw/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/examples/jigsaw/lodash-4.17.21
- dev-dependabot/npm_and_yarn/examples/jigsaw/y18n-3.2.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/examples/jigsaw/ini-1.3.7
- dev-dependabot/npm_and_yarn/examples/jigsaw/node-sass-4.14.1
- dev-dependabot/npm_and_yarn/examples/jigsaw/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/examples/jigsaw/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/examples/jigsaw/fstream-1.0.12
- dev-dependabot/npm_and_yarn/examples/jigsaw/mixin-deep-1.3.2
This package is auto-updated.
Last update: 2024-10-10 05:42:04 UTC
README
NOTE: This requires v1.8 of Parsedown, which has not been released yet.
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"><?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>
Using Parsedown Extra
Note: This requires version 0.8.0-beta-1
$parsedown = new \sixlive\ParsedownHighlightExtra; $parsedown->text(file_get_contents(__DIR__.'/README.md'));
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.