source: applications/nimpad/trunk/lib/HatenaSyntax.php @ 1490

SVN
Revision 1490, 1.4 KB checked in by anatoo, 10 months ago (diff)

0.2ブランチのリビジョン1489,1488の変更をtrunkに取り込んだ

Line 
1<?php
2/**
3 * @package HatenaSyntax
4 * @author anatoo<anatoo@nequal.jp>
5 * @license http://www.opensource.org/licenses/mit-license.php MIT License
6 * @version $Id: HatenaSyntax.php 1159 2009-09-06 09:43:29Z anatoo $
7 */
8
9include_once 'PEG.php';
10include_once dirname(__FILE__) . '/HatenaSyntax/Node.php';
11include_once dirname(__FILE__) . '/HatenaSyntax/Locator.php';
12include_once dirname(__FILE__) . '/HatenaSyntax/Factory.php';
13include_once dirname(__FILE__) . '/HatenaSyntax/NodeCreater.php';
14include_once dirname(__FILE__) . '/HatenaSyntax/Renderer.php';
15include_once dirname(__FILE__) . '/HatenaSyntax/TOCRenderer.php';
16include_once dirname(__FILE__) . '/HatenaSyntax/Util.php';
17include_once dirname(__FILE__) . '/HatenaSyntax/TreeRenderer.php';
18include_once dirname(__FILE__) . '/HatenaSyntax/Tree.php';
19include_once dirname(__FILE__) . '/HatenaSyntax/Tree/INode.php';
20include_once dirname(__FILE__) . '/HatenaSyntax/Tree/Node.php';
21include_once dirname(__FILE__) . '/HatenaSyntax/Tree/Root.php';
22include_once dirname(__FILE__) . '/HatenaSyntax/Tree/Leaf.php';
23
24class HatenaSyntax
25{
26    static function parse($str)
27    {
28        return HatenaSyntax_Locator::it()->parser->parse(PEG::context($str));
29    }
30   
31    static function render($str, $config = array())
32    {
33        $node = self::parse($str);
34        $renderer = new HatenaSyntax_Renderer($config);
35        return $renderer->render($node);
36    }
37}
Note: See TracBrowser for help on using the repository browser.