定制 kaloa/renderer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kaloa/renderer

最新稳定版本:v0.3.0

Composer 安装命令:

composer require kaloa/renderer

包简介

A collection of HTML output renderers

README 文档

README

Install

Via Composer:

$ composer require kaloa/renderer

Requirements

  • PHP >= 8.5

Demo

$ php -S localhost:9090 -t demos/renderer

Documentation

Usage

use Kaloa\Renderer\Factory;

$cm = Factory::createRenderer('commonmark');
echo $cm->render('**Hello *[World](http://example.org)*!**');
// <p><strong>Hello <em><a href="http://example.org">World</a></em>!</strong></p>

$bb = Factory::createRenderer('inigo');
echo $bb->render('[i]Hello [s]Moon[/s] [b]Earth[/b]![/i]');
// <p><em>Hello <s>Moon</s> <strong>Earth</strong>!</em></p>

// ...

Renderers

commonmark (third-party)

The league/commonmark parser for CommonMark.

inigo

This is basically a BBCode renderer. The parser tries to automatically add <p> elements where appropriate. Therefore, all tags are classified as inline or outline.

Supported tags:

  • i|em, b|strong
  • u, s|strike
  • icode
  • h1-h6
  • dl, dt, dd
  • ul, ol, li
  • table, tr, th, td
  • quote (=@author)
  • off|noparse
  • var
  • indent, center
  • url|link (=@href, @title)
  • img (=@src)
  • abbr (=@title)
  • html
  • code (=@lang)
  • fn, fnt
  • youtube
  • amazon

xml

todo

xmllegacy

todo

Testing

$ ./vendor/bin/phpunit

Further quality assurance:

$ ./vendor/bin/phpmd ./src text codesize,design,naming

Credits

License

The package is published under the MIT License. See LICENSE for full license info.

统计信息

  • 总下载量: 150
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-03-12