PHPackages                             sgrigorjev/adf-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sgrigorjev/adf-tools

ActiveLibrary

sgrigorjev/adf-tools
====================

Atlassian Document Format PHP Tools

1.2.2(1y ago)1298↓25%MITPHPPHP &gt;=7.4

Since Sep 22Pushed 6mo agoCompare

[ Source](https://github.com/sgrigorjev/adf-tools)[ Packagist](https://packagist.org/packages/sgrigorjev/adf-tools)[ RSS](/packages/sgrigorjev-adf-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

adf-tools
=========

[](#adf-tools)

Atlassian Document Format PHP Tools

This repository is a fork of Damien Harper's original repository [adf-tools](https://github.com/DamienHarper/adf-tools), with the following changes added:

- [Allow direct append for nodes for complex composition](https://github.com/sgrigorjev/adf-tools/pull/1): allow two alternative ways of constructing a document, one existing through a chain of calls, and one through a direct append of nodes for more complex documents.
- [Added extension node](https://github.com/sgrigorjev/adf-tools/pull/2): added `Extension` node that used in Confluence documents.

### Pull requests to the original repository

[](#pull-requests-to-the-original-repository)

- [Allow direct append for nodes for complex composition #16](https://github.com/DamienHarper/adf-tools/pull/16)
- [Added extension node (used in Confluence documents) #17](https://github.com/DamienHarper/adf-tools/pull/17)

If the listed pull requests are accepted by the original library author, this repository will no longer be needed, the original library should be used in that case.

Documentation
-------------

[](#documentation)

- Documentation of this library can be found [here](doc/index.md).
- [Official Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)
- [Atlassian Document Format JSON Schema](https://unpkg.com/@atlaskit/adf-schema@24.0.0/dist/json-schema/v1/full.json)

Main innovations
----------------

[](#main-innovations)

### Direct node append

[](#direct-node-append)

In addition to the existing document composition style:

```
$document = (new Document())
    ->bulletlist()
        ->item()
            ->paragraph()
                ->text('item 1')
            ->end()
        ->end()
        ->item()
            ->paragraph()
                ->text('item 2')
            ->end()
        ->end()
    ->end()
;
```

An alternative method has been added to directly add nodes for more complex composition:

```
$document = (new Document())
    ->append(
        (new BulletList())
            ->append(
                (new ListItem())
                    ->append(
                        (new Paragraph())
                            ->append(new Text('item 1'))
                    ),
                (new ListItem())
                    ->append(
                        (new Paragraph())
                            ->append(new Text('item 2'))
                    )

            )
    )
;
```

In this case, it will be possible to create and append nodes dynamically:

```
$paragraph = (new Paragraph())->append(new Text('Line 1'));

if (some condition) {
    $paragraph->append(new Text('(doc)', new Link('https://example.com/doc')));
}

$document = (new Document())->append($paragraph);
```

### Extension node

[](#extension-node)

Although element `Extension` is not described in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/), in practice it is used in documents for the Confluence. One of the most famous extensions is, for example, the **Table of Contents**.

A new node type `Extension` has been added:

```
$document = (new Document())
    ->extension(
        'default',
        'com.atlassian.confluence.macro.core',
        'toc',
        [
            "macroParams" => [
                "maxLevel" => [
                    "value" => "3"
                ],
                "minLevel" => [
                    "value" => "1"
                ],
                "outline" => [
                    "value" => "false"
                ],
                "printable" => [
                    "value" => "false"
                ],
                "type" => [
                    "value" => "list"
                ]
            ]
        ],
        '123cad9c-95d8-49df-8b99-00886ba0af5d',
    )
;
```

or using direct node append:

```
$document = (new Document())
    ->append(
        new Extension(
            'default',
            'com.atlassian.confluence.macro.core',
            'toc',
            [
                "macroParams" => [
                    "maxLevel" => [
                        "value" => "3"
                    ],
                    "minLevel" => [
                        "value" => "1"
                    ],
                    "outline" => [
                        "value" => "false"
                    ],
                    "printable" => [
                        "value" => "false"
                    ],
                    "type" => [
                        "value" => "list"
                    ]
                ]
            ],
            '123cad9c-95d8-49df-8b99-00886ba0af5d',
        )
    )
;
```

Credits
-------

[](#credits)

- Thanks to [all contributors](https://github.com/DamienHarper/adf-tools/graphs/contributors)

License
-------

[](#license)

`adf-tools` is free to use and is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance54

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~185 days

Total

5

Last Release

593d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87d02d365ea9a19a8f3953938d8c638931cb8cf04e082566a32ba9f7520408a6?d=identicon)[sgrigorjev](/maintainers/sgrigorjev)

---

Top Contributors

[![DamienHarper](https://avatars.githubusercontent.com/u/2448660?v=4)](https://github.com/DamienHarper "DamienHarper (16 commits)")[![sgrigorjev](https://avatars.githubusercontent.com/u/799305?v=4)](https://github.com/sgrigorjev "sgrigorjev (10 commits)")[![jrobinsonadrenaline](https://avatars.githubusercontent.com/u/17620324?v=4)](https://github.com/jrobinsonadrenaline "jrobinsonadrenaline (1 commits)")

---

Tags

atlassianadf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sgrigorjev-adf-tools/health.svg)

```
[![Health](https://phpackages.com/badges/sgrigorjev-adf-tools/health.svg)](https://phpackages.com/packages/sgrigorjev-adf-tools)
```

###  Alternatives

[damienharper/adf-tools

Atlassian Document Format PHP Tools

141.4M2](/packages/damienharper-adf-tools)[frozensheep/rightmove-adf

PHP library for the Rightmove Real Time Property Datafeed (ADF).

1945.1k](/packages/frozensheep-rightmove-adf)[thecatontheflat/atlassian-connect-bundle

Atlassian Connect Symfony Bundle

357.6k](/packages/thecatontheflat-atlassian-connect-bundle)[univerze/laravel-jira

Laravel5 service for Jira REST api to search and create issues

158.0k](/packages/univerze-laravel-jira)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
