DomCI : Update all the PHPDoc
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3279 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
69
markdown.php
69
markdown.php
@@ -9,10 +9,13 @@ class markdown
|
||||
/** To debug the markdown analyzer, activate the option */
|
||||
public $debug = false;
|
||||
|
||||
/** The list of the HTML elements used by block */
|
||||
private $blockid = array ("<h1>","<h2>","<h3>","<h4>","<h5>","<h6>",
|
||||
"<hr/>");
|
||||
|
||||
/** Convert the markdown text to html */
|
||||
/** Convert the markdown text to html
|
||||
* @param string $markdown The markdown to convert
|
||||
*/
|
||||
public function html ($markdown)
|
||||
{
|
||||
$markdown = rtrim ($markdown);
|
||||
@@ -47,7 +50,9 @@ class markdown
|
||||
return $html;
|
||||
}
|
||||
|
||||
/** Search and replace in the paragraph on one line */
|
||||
/** Search and replace in the paragraph on one line
|
||||
* @param string $line The line to analyze
|
||||
*/
|
||||
private function searchReplace ($line)
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -118,9 +123,10 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return HTML code corresponding to the code block
|
||||
@param array $text The Markdown text to translate split by \n
|
||||
@param integer $depth The depth of current bloc (in number of space)
|
||||
@param integer $pos The start line number of the bloc */
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
*/
|
||||
private function typeCode ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeCode (\$text, $depth, $pos)\n";
|
||||
@@ -143,9 +149,10 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return HTML code corresponding to the OL block
|
||||
@param array $text The Markdown text to translate split by \n
|
||||
@param integer $depth The depth of current bloc (in number of space)
|
||||
@param integer $pos The start line number of the bloc */
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
*/
|
||||
private function typeOL ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeOL (\$text, $depth, $pos)\n";
|
||||
@@ -155,9 +162,10 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return HTML code corresponding to the UL block
|
||||
@param array $text The Markdown text to translate split by \n
|
||||
@param integer $depth The depth of current bloc (in number of space)
|
||||
@param integer $pos The start line number of the bloc */
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
*/
|
||||
private function typeUL ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeUL (\$text, $depth, $pos)\n";
|
||||
@@ -166,6 +174,12 @@ class markdown
|
||||
return $content;
|
||||
}
|
||||
|
||||
/** Return the HTML code corresponding to the OL/UL block
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
* @param string $type The block type : "ul" or "ol"
|
||||
*/
|
||||
private function typeOLUL ($text, $depth, &$pos, $type)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeOLUL (\$text, $depth, $pos, $type)\n";
|
||||
@@ -230,8 +244,12 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return HTML code corresponding to the NONE block
|
||||
The NONE type exists only on empty strings. Just skip the current and
|
||||
empty line, and return an empty string */
|
||||
* The NONE type exists only on empty strings. Just skip the current and
|
||||
* empty line, and return an empty string
|
||||
* @param string $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of the current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
*/
|
||||
private function typeNONE ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeNONE (\$text, $depth, $pos)\n";
|
||||
@@ -240,9 +258,10 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return HTML code corresponding to the P block
|
||||
@param array $text The Markdown text to translate split by \n
|
||||
@param integer $depth The depth of current bloc (in number of space)
|
||||
@param integer $pos The start line number of the bloc */
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
*/
|
||||
private function typeP ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL typeP (\$text, $depth, $pos)\n";
|
||||
@@ -276,10 +295,11 @@ class markdown
|
||||
}
|
||||
|
||||
/** Detect the type of the text and call the appropriate function *
|
||||
@param array $text The Markdown text to translate split by \n
|
||||
@param integer $depth The depth of current bloc (in number of space)
|
||||
@param integer $pos The start line number of the bloc
|
||||
@return the HTML code */
|
||||
* @param array $text The Markdown text to translate split by \n
|
||||
* @param integer $depth The depth of current bloc (in number of space)
|
||||
* @param integer $pos The start line number of the bloc
|
||||
* @return the HTML code
|
||||
*/
|
||||
private function detectBlock ($text, $depth, &$pos)
|
||||
{
|
||||
if ($this->debug) echo "CALL detectBlock (\$text, $depth, $pos)\n";
|
||||
@@ -323,7 +343,9 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return the Type of object in the provided line
|
||||
p, ul, ol, code */
|
||||
* p, ul, ol, code
|
||||
* @param string $line The line to get the type
|
||||
*/
|
||||
private function lineType ($line)
|
||||
{
|
||||
if (! isset ($line{0}))
|
||||
@@ -338,8 +360,9 @@ class markdown
|
||||
}
|
||||
|
||||
/** Return the depth of the provided line
|
||||
@param string $line Line to analyze
|
||||
@return the depth of the line */
|
||||
* @param string $line Line to analyze
|
||||
* @return the depth of the line
|
||||
*/
|
||||
private function depth ($line)
|
||||
{
|
||||
return strspn ($line, " ");
|
||||
|
||||
Reference in New Issue
Block a user