PHP code example of 8fold / commonmark-fluent-markdown

1. Go to this page and download the library: Download 8fold/commonmark-fluent-markdown 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/ */

    

8fold / commonmark-fluent-markdown example snippets


use Eightfold\Markdown\Markdown;

print Markdown::create()->convert($markdown);

use Eightfold\Markdown\Markdown;

print Markdown::create()->minified()->convert($markdown);

use Eightfold\Markdown\Markdown;

print Markdown::create()->minified()->getFrontMatter($markdown);

[
  'title' => 'The title'
]


use Eightfold\Markdown\Markdown;
use Eightfold\Markdown\FluentCommonMark;

print Markdown::create()
  ->minified()
  ->gitHubFlavoredMarkdown()
  ->abbreviations()
  ->convert($markdown);

print FluentCommonMark::create()
  ->commonMarkCore()
  ->gitHubFlavoredMarkdown()
  ->abbreviations()
  ->convertToHtml($markdown)
  ->getContent();

use Eightfold\Markdown\Markdown;

print Markdown::create($markdown)
  ->disallowedRawHtml([
    'disallowed_tags' => ['div']
  ]);