corneltek/twig-markdown
最新稳定版本:1.0.0
Composer 安装命令:
composer require corneltek/twig-markdown
包简介
README 文档
README
convert markdowned text to html for Twig.
markdown converter is php-markdown-extra.
Install
Install via PEAR
Install via PEAR installer locally:
$ pear install -f package.xml
Install via PEAR installer from Corneltek PEAR channel:
$ pear install -a corneltek/Twig_Extensions_Markdown
Install via composer
Install composer in your project:
curl -s http://getcomposer.org/installer | php
Create a composer.json file in your project root:
{ "repositories": [ { "type": "package", "package": { "name": "michelf/php-markdown", "version": "1.0", "dist": { "url": "https://github.com/michelf/php-markdown/zipball/extra", "type": "zip" }, "autoload": { "files": [ "markdown.php" ] } } }, { "type": "vcs", "url": "http://github.com/geta6/Twig-Markdown" } ], "require": { "michelf/php-markdown": "1.*", "geta6/twig-markdown": "@dev" } }
Run install command:
php composer.phar install
Usage
{% markdown %}markdownedtext{% endmarkdown %}
or
{{ markdowned|markdown|raw }}
include
# use built-in twig autoloader require_once 'Twig/Autoloader.php'; Twig_Autoloader::register(); $debug = new \Twig_Extensions_Extension_Debug; $twig->addExtension( $debug ); $markdown = new \Twig_Extension_Markdown; $twig->addExtension( $markdown );
Development
To update the package.xml file, you need to install onion:
todo
むりやりincludeしてるのでもっとスマートな方法おしえてください
统计信息
- 总下载量: 288
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 3
其他信息
- 授权协议: Unknown
- 更新时间: 2015-07-13