PHP code example of moxio / commonmark-ext-definition-list
1. Go to this page and download the library: Download moxio/commonmark-ext-definition-list 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-definition-list example snippets
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use Moxio\CommonMark\Extension\DefinitionList\DefinitionListExtension;
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new DefinitionListExtension());
// Use $environment when building your CommonMarkConverter
$converter = new CommonMarkConverter([], $environment);
echo $converter->convertToHtml('
Term 1
: Definition of term 1.
Term 2
: Definition of term 2.
');