A Laravel PHP Composer packaged of useful CommonMark extensions for The PHP Leagues CommonMark implementation.
Instructions to install this extension to your Laravel project.
- PHP >= 7.1
- Laravel >= 5.5 + or 6.0 +
Follow these steps to get this CommonMark extension working in your Laravel project!
Run the following command at your root Laravel project directory (where package.json
exists).
$ composer require johnnyhuy/laravel-useful-commonmark-extension
Add JohnnyHuy\Laravel\UsefulCommonMarkExtension::class
in config/markdown.php
in the extensions
array. Here's an example:
'extensions' => [
...
JohnnyHuy\Laravel\UsefulCommonMarkExtension::class
...
],
Clone this repository and run composer install
to install all relevant Composer packages. Change the root extension directory and run the following command to execute PHPUnit test cases.
$ vendor/bin/phpunit tests/
I've composed a wiki page to describe features of this extension.
:gist https://gist.github.com/noxify/2b02fd0fb0ea18a4d9d764e31fe9af8e
:codepen https://codepen.io/YusukeNakaya/pen/XyOaBj
:soundcloud https://soundcloud.com/djtechnoboy/tnt-sound-rush-right-now
:youtube https://www.youtube.com/watch?v=pwmY1XUTBpE
# Worded colors
:color red
Hello I should be in red text :D
:color
:color-red this is inline! :color
# 3 Character hex
:color #AAA
Hello!
:color
:color-#AAA this is inline! :color
# 6 Character hex
:color #DADADA
Hello!
:color
:color-#DADADA this is inline! :color
# RGB
:color 255,255,255
Hello!
:color
:color-255,255,255 this is inline! :color
# RGBA
:color 255,255,255,50
Hello!
:color
:color-255,255,255,50 this is inline! :color
# Center alignment
:text-center
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-center
# Right alignment
:text-right
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-right
# Left alignment
:text-left
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean tincidunt urna maximus sem congue, viverra ultrices purus porta. Aenean at porta mi. Donec ut felis consectetur, rutrum mauris non, sagittis ipsum. Quisque sit amet fringilla lorem. Curabitur euismod imperdiet nunc, et vehicula lorem scelerisque et. Fusce rutrum id lectus in pellentesque. Donec vel cursus dolor. Ut placerat justo nunc, a imperdiet libero posuere non. Nullam dolor ligula, efficitur a accumsan non, viverra quis lorem. Mauris at auctor ligula.
:text-left
- Project derived from Graham Campbell's emoji parser for Laravel
- Johnny Huynh - Initial changes
This project is licensed under the MIT license, see LICENSE for more information.
- league/commonmark is licensed under the BSD-3 license
- GrahamCampbell/Laravel-Markdown is licensed under the MIT License
- AltThree/Emoji is licensed under the MIT License