PHP code example of blizzard-fs / md2html

1. Go to this page and download the library: Download blizzard-fs/md2html 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/ */

    

blizzard-fs / md2html example snippets




$parser = new MarkdownParser();
$html = $parser->parse('# Hello **world**');



use BlizzardFs\Md2Html\MarkdownParser;

$parser = new MarkdownParser();
$html = $parser->parse('# Hello **world**');

use BlizzardFs\Md2Html\CarbonHtmlRenderer;
use BlizzardFs\Md2Html\MarkdownParser;

$renderer = new CarbonHtmlRenderer();
$parser = new MarkdownParser($renderer);
$html = $parser->parse($markdown);

use BlizzardFs\Md2Html\MarkdownParser;
use BlizzardFs\Md2Html\ParserOptions;

$options = (new ParserOptions())
    ->setHeadingIds(true)
    ->setNoFollowLinks(true)
    ->setSafeMode(true);

$parser = new MarkdownParser(options: $options);
$html = $parser->parse($markdown);

use BlizzardFs\Md2Html\RendererInterface;
use BlizzardFs\Md2Html\MarkdownParser;

class MyRenderer implements RendererInterface
{
    // 22 methods - one per element type
    // See src/RendererInterface.php for the full contract
}

$parser = new MarkdownParser(new MyRenderer());