jmsfwk/adf-builder
最新稳定版本:1.0.1
Composer 安装命令:
composer require jmsfwk/adf-builder
包简介
A library that simplifies building documents that follow the Atlassian Document Format structure.
README 文档
README
A library that simplifies building documents that follow the Atlassian Document Format structure.
This is based on pyadf (Python) and adf-builder (JavaScript).
Installation
Install the package using
composer require jmsfwk/adf-builder
Usage
use Jmsfwk\Adf\Document; $doc = new Document(); $doc->paragraph() ->text('See the ') ->link('documention', 'https://example.com') ->text(' ') ->emoji('smile');
Serialization
A document can be serialized in different ways:
$doc = new Document(); $doc->toJson(); // Returns a compact JSON string json_encode($doc); // Equivalent to '$doc->toString()'
Examples
Simple paragraphs
In order to get an output like:
Hello @joe, please carefully read this contract
You would use:
use Jmsfwk\Adf\Document; $doc = new Document(); $doc->paragraph() ->text('Hello ') ->mention($id, 'joe') ->text(', please ') ->em('carefully') ->text(' read ') ->link('this contract', 'https://www.example.com/contract');
统计信息
- 总下载量: 16.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-23