Ciconia / A New Markdown Parser for #PHP

Markdown Syntax

Headings

H1/H2 (Set-ext style) Core\HeaderExtension 1.0

H1 is underlined using equal signs, and H2 is underlined using dashes.

H1~H6 (Atx-style) Core\HeaderExtension 1.0

Atx-style headers use 1-6 hash characters at the start of the line.

Paragraphs

Paragraphs Core\ParagraphExtension 1.0

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.

Blockquotes

Blockquotes Core\BlockQuoteExtension 1.0

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.

Blockquotes can be nested.

Blockquotes can contain other Markdown elements.

Lists

Unordered Lists Core\ListExtension 1.0

Start each line with hyphens, asterisks or pluses.

Ordered Lists Core\ListExtension 1.0

Start each line with number and a period.

Code Blocks / Inline Code

Code Blocks Core\CodeExtension 1.0

Inline Code Core\CodeExtension 1.0

Horizontal Rules

Horizontal Rules Core\HorizontalRuleExtension 1.0

Inline Links Core\LinkExtension 1.0

Reference-style Links Core\LinkExtension 1.0

Emphasis

Bold and Italics Core\InlineStyleExtension 1.0

Images

Inline Images Core\ImageExtension 1.0

Reference-style Images Core\ImageExtension 1.0

Github Flavored Markdown Syntax

You have to activate Gfm/* extensions if you prefer to use following syntax.

URL Autolinking Gfm\UrlAutoLinkExtension 1.0

You have to activate Gfm\UrlAutoLinkExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\UrlAutoLinkExtension());

GFM will autolink standard URLs, so if you want to link to a URL (instead of setting link text), you can simply enter the URL and it will be turned into a link to that URL.

Emphasis

Strikethrough Gfm\InlineStyleExtension 1.0

You have to activate Gfm\InlineStyleExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\InlineStyleExtension());

Fenced code blocks

Code Blocks Gfm\FencedCodeBlockExtension 1.0

You have to activate Gfm\FencedCodeBlockExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\FencedCodeBlockExtension());

Just wrap your code blocks in ``` and you won't need to indent manually to trigger a code block.

Syntax Highlighting Gfm\FencedCodeBlockExtension 1.0

You have to activate Gfm\FencedCodeBlockExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\FencedCodeBlockExtension());

As of 1.0, FencedCodeBlockExtension only supports **google-code-prettify**. To get colored output, You have to include the script tag below in your document.

<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>

Task Lists

Task Lists Gfm\TaskListExtension 1.0

You have to activate Gfm\TaskListExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\TaskListExtension());

Tables

Tables Gfm\TableExtension 1.0

You have to activate Gfm\TableExtension to use this syntax.

$ciconia->addExtension(new \Ciconia\Extension\Gfm\TableExtension());

Prev: Recipes  Next: Development