Issue
I know how to use php-markdown by loading it manually, but decided to install it through pear. Installed with the following commands:
pear channel-discover pear.michelf.com
pear install michelf/MarkdownExtra
>> install ok: channel://pear.michelf.com/MarkdownExtra-1.2.5
The problem is that I have no idea on how to use it when installed from pear and the documentation does not informs anything about it, so I think it might be a pretty dumb question.
Here is how I tried to use it:
if(class_exists('MarkdownExtra_Parser')){
$m = MarkdownExtra_Parser();
$html = $m->transform($string);
}
and:
$html = Markdown($string);
anyone?
Solution
When it's installed OK, it gets installed into the base PEAR directory - which should be in the include path.
<?php
require_once 'markdown.php'
$mdtext= "... markdown text ...";
echo Markdown($mdtext)
$parser = new MarkdownExtra_Parser;
echo $parser->transform($mdtext);
will output the two sets of HTML based on the contents of $mdtext.
There are some instructions on http://michelf.com/projects/php-markdown/
Answered By - Alister Bulman Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.