Ciconia / A New Markdown Parser for #PHP

Basic Usage

Transform Markdown into HTML

require __DIR__ . '/vendor/autoload.php';

use Ciconia\Ciconia;

$ciconia = new \Ciconia\Ciconia();
$html = $ciconia->render($markdown);

Enable Github Flavored Markdown

require __DIR__ . '/vendor/autoload.php';

use Ciconia\Ciconia;
use Ciconia\Extension\Gfm;

$ciconia = new \Ciconia();
$ciconia->addExtension(new Gfm\FencedCodeBlockExtension());
$ciconia->addExtension(new Gfm\TaskListExtension());
$ciconia->addExtension(new Gfm\InlineStyleExtension());
$ciconia->addExtension(new Gfm\WhiteSpaceExtension());
$ciconia->addExtension(new Gfm\TableExtension());
$ciconia->addExtension(new Gfm\UrlAutoLinkExtension());
$html = $ciconia->render($markdown);
If you are interested in extension, check the Extending Ciconia section.

Rendering HTML or XHTML

Ciconia renders HTML by default. If you prefer XHTML,

use Ciconia\Ciconia;
use Ciconia\Renderer\XhtmlRenderer;

$ciconia = new Ciconia(new XhtmlRenderer());
$html = $ciconia->render('Markdown is **awesome**');

Prev: Installation  Next: Extending Ciconia