A Mustache + Shortcode + Markdown = Mushdown parser for your modern app

1.0.0 2022-03-31 17:31 UTC

This package is not auto-updated.

Last update: 2024-06-04 03:20:23 UTC


Build Status Coverage Status Packagist Packagist Packagist

Mushdown, modern parser for modern app.


Install via composer

composer require blok/mushdown

Publish Configuration File

php artisan vendor:publish --provider="Blok\Mushdown\ServiceProvider" --tag="config"


How to register a shortcode ?

The shortcode methode works like Wordpress short code, you have 2 params the attributes and the content.

You can register a shortcode like that :

app('mushdown')->register('quote', function ($attr, $content = null) {
    return '<quote '.Html::attributes($attr).'>' . app('mushdown')->compile($content) . '</quote>';

echo mushdown(<<<EOT
# Heading

- list

[quote class="mt-2"]Test quote[/quote]


EOT, ['user' => ['name' => 'John']]);

will output :

<h1 id="heading">Heading</h1>
<p><quote  class="mt-2">Test quote</quote></p>

Order of processing

The Mushdown parser are in this order so it won't make normaly any issue or overlapse :

  1. Shortcode : In house implementation
  2. Mustache :
  3. Markdown :


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


This package is bootstrapped with the help of blok/laravel-package-generator.