Skip to content

five59/laravel-useful-commonmark-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Useful CommonMark Extension

Build Status Latest Stable Version Total Downloads composer.lock available

A Laravel PHP Composer packaged of useful CommonMark extensions for The PHP Leagues CommonMark implementation.

Getting started

Instructions to install this extension to your Laravel project.

Prerequisites

  • PHP >= 7.1
  • Laravel >= 5.5

Installation

Follow these steps to get this CommonMark extension working in your Laravel project!

Installing the Composer package

Run the following command at your root Laravel project directory (where package.json exists).

$ composer require johnnyhuy/laravel-useful-commonmark-extension

Adding the Markdown extension to a config

Add JohnnyHuy\Laravel\UsefulCommonMarkExtension::class in config/markdown.php in the extensions array. Here's an example:

'extensions' => [
    ...
    JohnnyHuy\Laravel\UsefulCommonMarkExtension::class
    ...
],

(Optional) Adding the service provider to app config

If automatic package discovery is not enabled in your project, add the following line to register the service provider in your config/app.php. Here's an example:

'providers' => [
    ...
    JohnnyHuy\Laravel\UsefulCommonMarkExtensionServiceProvider::class,
    ...
],

Running the tests

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/

Wiki

I've composed a wiki page to describe features of this extension.

Markdown features

Gist

:gist https://gist.github.com/noxify/2b02fd0fb0ea18a4d9d764e31fe9af8e

Codepen

:codepen https://codepen.io/YusukeNakaya/pen/XyOaBj

SoundCloud

:soundcloud https://soundcloud.com/djtechnoboy/tnt-sound-rush-right-now

More info

YouTube

:youtube https://www.youtube.com/watch?v=pwmY1XUTBpE

More info

Vimeo

:vimeo https://vimeo.com/152779982

More info

Color

# Worded colors
:color red
Hello I should be in red text :D
:color

# 3 Character hex
:color #AAA
Hello!
:color

# 6 Character hex
:color #DADADA
Hello!
:color

# RGB
:color 255,255,255
Hello!
:color

# RGBA
:color 255,255,255,50
Hello!
:color

More info

Text Alignment

# 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

More info

Contribution

License

This project is licensed under the MIT license, see LICENSE for more information.

About

A useful CommonMark extention for Laravel projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%