public function render($content)
 {
     $parser = new Tx\Parser('html5');
     $html = $this->getLayoutHead();
     $html .= $parser->textileThis($content);
     $html .= $this->getLayoutFooter();
     return $html;
 }
Exemplo n.º 2
0
function smarty_block_textile($params, $content, $template, &$repeat)
{
    if (!$repeat) {
        if (isset($content)) {
            $parser = new Parser();
            return $parser->textileThis($content);
        }
    }
}
Exemplo n.º 3
0
 /**
  * Parse and transform Textile strings into HTML
  *
  * @param string  $string  text to transform
  * @return string
  */
 public static function textile($string)
 {
     // start measuring
     $hash = Debug::markStart('parsing', 'textile');
     $parser = new Textile();
     $result = $parser->textileThis($string);
     // end measuring
     Debug::markEnd($hash);
     Debug::increment('parses', 'textile');
     return $result;
 }
 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -  
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in 
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function index()
 {
     // var_dump($this->ion_auth->user()->row());
     $this->load->view('welcome_message');
     $parser = new Textile\Parser();
     $string = 'h1. Welcome' . PHP_EOL . PHP_EOL;
     $string .= '* List 1' . PHP_EOL;
     $string .= '* List 2' . PHP_EOL;
     $string .= '* List 3' . PHP_EOL;
     echo $parser->textileThis($string);
 }
Exemplo n.º 5
0
 /**
  * Parses content in a restricted mode.
  *
  * @param  string|null $text    The input document in textile format
  * @param  bool|null   $lite    Optional flag to switch the parser into lite mode
  * @param  bool|null   $noimage Optional flag controlling the conversion of images into HTML img tags
  * @param  string|null $rel     Relationship to apply to all generated links
  * @return string The text from the input document
  */
 public function textileRestricted($text, $lite = null, $noimage = null, $rel = null)
 {
     if ($lite === null) {
         $lite = get_pref('comments_use_fat_textile', 1);
     }
     if ($noimage === null) {
         $noimage = get_pref('comments_disallow_images', 1);
     }
     if ($rel === null && get_pref('comment_nofollow', 1)) {
         $rel = 'nofollow';
     }
     return parent::textileRestricted($text, $lite, $noimage, $rel);
 }
Exemplo n.º 6
0
 /**
  * Parse the incoming template
  *
  * @param string $tpl Source template content
  * @param array $vars List of variables passed to template engine
  *
  * @return string Processed template
  */
 public function render($tpl, $vars = array())
 {
     return $this->textile->TextileThis($tpl);
 }
Exemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function convert(ConverterContextInterface $converterContext)
 {
     $converterContext->setContent($this->parser->textileThis($converterContext->content()));
 }
Exemplo n.º 8
0
 /**
  * @TODO
  * @TODO Test
  * @return Document
  */
 public function render()
 {
     switch ($this->format) {
         case 'html':
             $this->output = $this->body;
             break;
         case 'textile':
             $parser = new Textile();
             $this->output = $parser->textileThis($this->body);
             break;
         default:
             // 'md'
             $parser = new Markdown();
             $this->output = $parser->text($this->body);
     }
     return $this;
 }
Exemplo n.º 9
0
function smarty_modifier_textile($string)
{
    $parser = new Parser();
    return $parser->textileThis($string);
}
Exemplo n.º 10
0
 /**
  * Parse Content
  *
  * @param  string $content
  * @return string
  */
 public static function parse($content)
 {
     $parser = new Parser();
     return $parser->textileThis($content);
 }
Exemplo n.º 11
0
Arquivo: c.php Projeto: ngtp/page
<?php

require_once 'Netcarver/Textile/DataBag.php';
require_once 'Netcarver/Textile/Tag.php';
require_once 'Netcarver/Textile/Parser.php';
use Netcarver\Textile\Parser as Textile;
$c = "";
if (isset($_REQUEST['c'])) {
    $c = $_REQUEST['c'];
}
if (isset($_POST['c'])) {
    $c = $_POST['c'];
}
$textile = new Textile();
echo $textile->textileThis($c);