PHP code example of daysofwonder / phpleague-commonmark-implicit-figures

1. Go to this page and download the library: Download daysofwonder/phpleague-commonmark-implicit-figures 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/ */

    

daysofwonder / phpleague-commonmark-implicit-figures example snippets


use League\CommonMark\Converter;
use League\CommonMark\DocParser;
use League\CommonMark\Environment;
use League\CommonMark\HtmlRenderer;
use DoW\CommonMark\ImplicitFigures\Extension;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new \DoW\CommonMark\ImplicitFigures\Extension());

$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

echo $converter->convertToHtml('![title](fig.png)');