PHP code example of moxio / commonmark-ext-fancy-lists

1. Go to this page and download the library: Download moxio/commonmark-ext-fancy-lists 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/ */

    

moxio / commonmark-ext-fancy-lists example snippets


use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\MarkdownConverter;
use Moxio\CommonMark\Extension\FancyLists\FancyListsExtension;

$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new FancyListsExtension());

// Use $environment when building your MarkdownConverter
$converter = new MarkdownConverter($environment);
echo $converter->convertToHtml('
a) foo
b) bar
c) baz
');

use League\CommonMark\Environment\Environment;

$environment = new Environment([
    'fancy_lists' => [
        'allow_ordinal' => true,
        // ...
    ],
]);