dev-master
9999999-devA library that simplifies building documents that follow the Atlassian Document Format structure.
MIT
The Requires
- php ^7.0
The Development Requires
by James Fenwick
A library that simplifies building documents that follow the Atlassian Document Format structure.
A library that simplifies building documents that follow the Atlassian Document Format structure., (*1)
This is based on pyadf (Python) and adf-builder (JavaScript)., (*2)
Install the package using, (*3)
composer require jmsfwk/adf-builder
use Jmsfwk\Adf\Document; $doc = new Document(); $doc->paragraph() ->text('See the ') ->link('documention', 'https://example.com') ->text(' ') ->emoji('smile');
A document can be serialized in different ways:, (*4)
$doc = new Document(); $doc->toJson(); // Returns a compact JSON string json_encode($doc); // Equivalent to '$doc->toString()'
In order to get an output like:, (*5)
Hello @joe, please carefully read this contract, (*6)
You would use:, (*7)
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');
A library that simplifies building documents that follow the Atlassian Document Format structure.
MIT