定制 linkorb/interlink 二次开发

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

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

linkorb/interlink

最新稳定版本:v1.0.0

Composer 安装命令:

composer require linkorb/interlink

包简介

Interlink parser

README 文档

README

Interlink let's you define custom link handlers for wiki links.

Some example:

Translate [[wikipedia:Hello world]] into:

<a href="http://www.wikipedia.org/Hello_world" target="_blank">
    Hello world
</a>

Translate [[wikihow:Grow an Orange Tree]] into:

<a href="http://www.wikihow.com/Grow-an-Orange-Tree">
    Grow an Orange Tree
</a>

Translate [[mozilla-bugzilla:441207]] into:

<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=441207">
    Printing selection causes blank page with header/footer only
</a>

Translate [[mytaskdb:14]] into:

<a href="https://intranet.example.web/task/14">
    Redesign widgets to optimize alignment with KPI's
</a>

Using Interlink, you define Handlers for link prefixes (Like above: 'wikihow', or 'mytaskdb'). The handler can then automatically translate the link into a working bit of HTML using one of the available Renderers.

You can even create your own Renderer if the provided ones are not sufficient.

You can also pass a LabelResolver to your handler to translate the code or id into a userfriendly text. For example, look up a task title in the database using PDO, based on the id in the link. Or make a REST API call to a webservice to convert a bugid into a readable summary.

How to use Interlink in your application

Simply add the following to your require or require-dev section in your composer.json and run composer update:

"require": {
  "linkorb/interlink": "~1.0"
}

Examples:

Please refer to the examples/ directory for some simple and advanced examples.

License

MIT (see LICENSE.md)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering.

Btw, we're hiring!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-28