PHP code example of ryangjchandler / commonmark-blade-block

1. Go to this page and download the library: Download ryangjchandler/commonmark-blade-block library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ryangjchandler / commonmark-blade-block example snippets


use League\CommonMark\MarkdownConverter;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use RyanChandler\CommonmarkBladeBlock\BladeExtension;

$environment = new Environment();

$environment
    ->addExtension(new CommonMarkCoreExtension)
    ->addExtension(new BladeExtension);

$converter = new MarkdownConverter($environment);

Str::markdown(
    <<<'MD'
    @blade
        <x-button></x-button>
    @endblade
    MD,
    extensions: [
        new BladeExtension(),
    ]
)