PHPackages                             jira-adf/html-to-adf - 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. jira-adf/html-to-adf

ActiveLibrary

jira-adf/html-to-adf
====================

Convert HTML, Markdown, and Plain Text to Atlassian Document Format (ADF)

0485—0%2PHP

Since Mar 16Pushed 5d agoCompare

[ Source](https://github.com/ceykiii/html-to-adf)[ Packagist](https://packagist.org/packages/jira-adf/html-to-adf)[ RSS](/packages/jira-adf-html-to-adf/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

html-to-adf
===========

[](#html-to-adf)

A PHP library to convert **HTML**, **Markdown**, and **Plain Text** into Atlassian Document Format (ADF) — compatible with Jira &amp; Confluence.

---

Features
--------

[](#features)

- Recursive HTML parsing via DOM
- Headings, Paragraphs, Emphasis, Strong, Links, Lists, Code Blocks, Tables, Images
- Markdown-to-ADF using `league/commonmark`
- Plain text support
- Pluggable converter architecture
- Composer-based install
- Testable, extensible &amp; PSR-compliant

---

Installation
------------

[](#installation)

```
composer require your-vendor/html-to-adf
```

---

Usage
-----

[](#usage)

### Initialize `ConverterManager` and register converters

[](#initialize-convertermanager-and-register-converters)

```
use HtmlToAdf\ConverterManager;
use HtmlToAdf\Converters\HtmlConverter;
use HtmlToAdf\Converters\MarkdownConverter;
use HtmlToAdf\Converters\PlainTextConverter;

$manager = new ConverterManager();
$manager->registerConverter(new HtmlConverter());
$manager->registerConverter(new MarkdownConverter());
$manager->registerConverter(new PlainTextConverter());
```

---

### Convert HTML

[](#convert-html)

```
$html = 'HelloThis is a test.';
$adf = $manager->convert('html', $html);

print_r($adf);
```

---

### Convert Markdown

[](#convert-markdown)

```
$markdown = "## Hello\nThis is a **test**.";
$adf = $manager->convert('markdown', $markdown);

print_r($adf);
```

---

### Convert Plain Text

[](#convert-plain-text)

```
$text = "Just a simple paragraph.";
$adf = $manager->convert('text', $text);

print_r($adf);
```

---

ADF Output Example
------------------

[](#adf-output-example)

**Input:**

```
Hello world!
```

**Output:**

```
{
  "version": 1,
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        { "type": "text", "text": "Hello " },
        {
          "type": "text",
          "text": "world",
          "marks": [{ "type": "strong" }]
        },
        { "type": "text", "text": "!" }
      ]
    }
  ]
}
```

---

Architecture
------------

[](#architecture)

ComponentDescription`ConverterManager`Manages format dispatching to converters`ConverterInterface`Interface for pluggable format converters`HtmlConverter`Parses DOM and builds ADF recursively`MarkdownConverter`Uses CommonMark, then delegates to HTML`PlainTextConverter`Wraps text in paragraph ADF structure`AdfNodeBuilder`(Optional) Helps build consistent ADF output---

Author
------

[](#author)

**Cem Açar**

---

License
-------

[](#license)

Licensed under the [MIT License](LICENSE).

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance65

Regular maintenance activity

Popularity18

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/89fc29330f37081b589de7d1ff0fd86258a4e5848fa9de616a4751dcb991a49c?d=identicon)[ceykiii](/maintainers/ceykiii)

### Embed Badge

![Health badge](/badges/jira-adf-html-to-adf/health.svg)

```
[![Health](https://phpackages.com/badges/jira-adf-html-to-adf/health.svg)](https://phpackages.com/packages/jira-adf-html-to-adf)
```

PHPackages © 2026

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