PHP code example of evirma / commonmark-ext-attributes
1. Go to this page and download the library: Download evirma/commonmark-ext-attributes 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/ */
evirma / commonmark-ext-attributes example snippets
use League\CommonMark\Converter;
use League\CommonMark\DocParser;
use League\CommonMark\Environment;
use League\CommonMark\HtmlRenderer;
use Evirma\CommonMark\Extension\AttributesExtension;
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new AttributesExtension());
$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));
echo $converter->convertToHtml('# Hello World! {#hello}');