View Source

<ac:macro ac:name="info"><ac:parameter ac:name="title">Zend_Markup_Parser_Markdown</ac:parameter><ac:rich-text-body>
<p>This page has been created from a template that uses &quot;zones.&quot; To proceed:</p>
<ol>
<li>Edit the page</li>
<li>Replace sample content within each zone-data tag with your own content</li>
<li>Remove this notice</li>
<li>Save the page</li>
<li>When you are ready for community review, move this page to the <ac:link><ri:page ri:content-title="Ready for Review" /></ac:link> section on the edit page.
<ac:macro ac:name="note"><ac:parameter ac:name="title">No placeholders allowed!</ac:parameter><ac:rich-text-body>
<p>Please do not create placeholders. Wait until you have sufficient content to replace all sample data in the proposal template before creating your proposal document.</p></ac:rich-text-body></ac:macro></li>
</ol>
</ac:rich-text-body></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Markup_Parser_Markdown
{zone-data}

{zone-data:proposer-list}
[Boris Guéry|mailto:guery.b@gmail.com]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
0.1 - 1 March 2011: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Markup_Parser_Markdown is a parser for the wiki markup Markdown.
{zone-data}

{zone-data:references}
* [Official Markdown website|http://www.cforcoding.com/search/label/markdown]
* [Python Implentation of Markdown|http://www.freewisdom.org/projects/python-markdown/]
* [Wikipedia|http://en.wikipedia.org/wiki/Markdown]
* [Some article on the writting of a Markdown parser|http://www.cforcoding.com/search/label/markdown]
* [PHP implentation of Markdown|http://michelf.com/projects/php-markdown/]
{zone-data}

{zone-data:requirements}
Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

* This component *will* parse Markdown accordingly to the [official Markdown syntax|http://daringfireball.net/projects/markdown/syntax]
* This component *will* fill a Zend_Markup_TokenList
* This component *would* supports Markdown Extra (Extra markup for uncommon elements)
* This component *will* not be aware of the renderer
* This component *will* implement Zend_Markup_Parser_ParserInterface
{zone-data}

{zone-data:dependencies}
* Zend_Markup_Parser_ParserInterface
* Zend_Markup_Token
* Zend_Markup_TokenList
{zone-data}

{zone-data:operation}
The component is mainly provided to be used through Zend_Markup factory method to be rendered with any Zend_Markup_Renderer_*.
However, it could be used as is to return a Zend_Markup_Tokenlist tree instance.
{zone-data}

{zone-data:milestones}
* Milestone 1: [design notes will be published here|http://framework.zend.com/wiki/x/sg]
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
* Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend_Magic_Parser_Markdown
{zone-data}

{zone-data:use-cases}
||UC-01||
{code}
$markdown = <<
# Zend\_Markup\_Parser\_Markdown

## Requirements

* This component **will** parse Markdown accordingly to the [official Markdown syntax](http://daringfireball.net/projects/markdown/syntax)
* This component **will** fill a Zend\_Markup\_TokenList
* This component **would** supports Markdown Extra (Extra markup for uncommon elements)
* This component **will** not be aware of the renderer
* This component **will** implement Zend\_Markup\_Parser\_ParserInterface
EOF;

$m = Zend_Markup::factory('Markdown');
echo $m->render($markdown);

// result:

/*
<h1>Zend_Markup_Parser_Markdown</h1>

<h2>Requirements</h2>

<ul>
<li>This component <strong>will</strong> parse Markdown accordingly to the <a href="http://daringfireball.net/projects/markdown/syntax">official Markdown syntax</a></li>
<li>This component <strong>will</strong> fill a Zend_Markup_TokenList</li>
<li>This component <strong>would</strong> supports Markdown Extra (Extra markup for uncommon elements)</li>
<li>This component <strong>will</strong> not be aware of the renderer</li>
<li>This component <strong>will</strong> implement Zend_Markup_Parser_ParserInterface</li>
</ul>

*/
{code}



{zone-data}

{zone-data:skeletons}
{code}
class Zend_Markup_Parser_Markdown implements Zend_Markup_Parser_ParserInterface {}


{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>