Skip to content

Commit

Permalink
Headers ... ouf !
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.php.net/repository/pear/packages/Text_Wiki/trunk@191862 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
bertrand Gugger committed Jul 30, 2005
1 parent 50e0d22 commit afcc98e
Show file tree
Hide file tree
Showing 43 changed files with 1,470 additions and 523 deletions.
43 changes: 27 additions & 16 deletions Text/Wiki/Render/Xhtml/Anchor.php
@@ -1,37 +1,48 @@
<?php

// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
*
* This class renders an anchor target name in XHTML.
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones at ciaweb dot net>
*
* @package Text_Wiki
*
*/
* Anchor rule end renderer for Xhtml
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id$
* @link http://pear.php.net/package/Text_Wiki
*/

/**
* This class renders an anchor target name in XHTML.
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Render_Xhtml_Anchor extends Text_Wiki_Render {

var $conf = array(
'css' => null
);

function token($options)
{
extract($options); // $type, $name

if ($type == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
$format = "<a$css id=\"%s\">";
return sprintf($format, htmlentities($name));
}

if ($type == 'end') {
return '</a>';
}
}
}

?>
?>
49 changes: 36 additions & 13 deletions Text/Wiki/Render/Xhtml/Blockquote.php
@@ -1,46 +1,69 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Blockquote rule end renderer for Xhtml
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id$
* @link http://pear.php.net/package/Text_Wiki
*/

/**
* This class renders a blockquote in XHTML.
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Render_Xhtml_Blockquote extends Text_Wiki_Render {

var $conf = array(
'css' => null
);

/**
*
*
* Renders a token into text matching the requested format.
*
*
* @access public
*
*
* @param array $options The "options" portion of the token (second
* element).
*
*
* @return string The text rendered from the token options.
*
*
*/

function token($options)
{
$type = $options['type'];
$level = $options['level'];

// set up indenting so that the results look nice; we do this
// in two steps to avoid str_pad mathematics. ;-)
$pad = str_pad('', $level, "\t");
$pad = str_replace("\t", ' ', $pad);

// pick the css type
$css = $this->formatConf(' class="%s"', 'css');

// starting
if ($type == 'start') {
return "$pad<blockquote$css>";
}

// ending
if ($type == 'end') {
return $pad . "</blockquote>\n";
}
}
}
?>
?>
41 changes: 32 additions & 9 deletions Text/Wiki/Render/Xhtml/Bold.php
@@ -1,34 +1,57 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Bold rule end renderer for Xhtml
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id$
* @link http://pear.php.net/package/Text_Wiki
*/

/**
* This class renders bold text in XHTML.
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Render_Xhtml_Bold extends Text_Wiki_Render {

var $conf = array(
'css' => null
);

/**
*
*
* Renders a token into text matching the requested format.
*
*
* @access public
*
*
* @param array $options The "options" portion of the token (second
* element).
*
*
* @return string The text rendered from the token options.
*
*
*/

function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<b$css>";
}

if ($options['type'] == 'end') {
return '</b>';
}
}
}
?>
?>
41 changes: 32 additions & 9 deletions Text/Wiki/Render/Xhtml/Box.php
@@ -1,34 +1,57 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Box rule end renderer for Xhtml
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id$
* @link http://pear.php.net/package/Text_Wiki
*/

/**
* This class renders a box drawn in XHTML.
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Render_Xhtml_Box extends Text_Wiki_Render {

var $conf = array(
'css' => null
);

/**
*
*
* Renders a token into text matching the requested format.
*
*
* @access public
*
*
* @param array $options The "options" portion of the token (second
* element).
*
*
* @return string The text rendered from the token options.
*
*
*/

function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<div class='simplebox'$css>";
}

if ($options['type'] == 'end') {
return '</div>';
}
}
}
?>
?>
37 changes: 30 additions & 7 deletions Text/Wiki/Render/Xhtml/Break.php
@@ -1,29 +1,52 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Break rule end renderer for Xhtml
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id$
* @link http://pear.php.net/package/Text_Wiki
*/

/**
* This class renders line breaks in XHTML.
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Render_Xhtml_Break extends Text_Wiki_Render {

var $conf = array(
'css' => null
);

/**
*
*
* Renders a token into text matching the requested format.
*
*
* @access public
*
*
* @param array $options The "options" portion of the token (second
* element).
*
*
* @return string The text rendered from the token options.
*
*
*/

function token($options)
{
$css = $this->formatConf(' class="%s"', 'css');
return "<br$css />\n";
}
}

?>
?>

0 comments on commit afcc98e

Please sign in to comment.