Download the PHP package unzeroun/isocontent without Composer

On this page you can find all versions of the php package unzeroun/isocontent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package isocontent

Isocontent

CI Status Coverage Status Mutation testing badge License: GPL v3

Isocontent is a PHP library that transforms rich‑text content (such as HTML) into a platform‑agnostic Abstract Syntax Tree (AST). The AST can then be rendered back to any target format — HTML, JSON, React Native, mobile views, or anything else you need.

Typical use‑case: accept content from a WYSIWYG editor, store it as a portable AST, and render it on any platform.

Installation

Requires PHP >= 8.2. The DOMParser needs ext-dom and ext-libxml; the JSONRenderer needs ext-json.

End‑to‑End Demo

The Isocontent service is the main entry point. Register parsers and renderers, then parse and render content in any supported format:

Core Concepts

Isocontent models content as a tree of nodes:

Class Description
TextNode Leaf node holding a plain text value.
BlockNode Structural element (paragraph, heading, link…) with optional children and typed arguments.
NodeList Ordered collection of nodes — this is what parsers produce and renderers consume.

Block Types

The DOMParser maps HTML elements to the following block types:

Block Type HTML Tag(s) Arguments
paragraph <p>
title <h1><h6> level (int 1–6)
strong <strong>
emphasis <em>
inline_text <span>
link <a> href (string)
list <ul>, <ol> ordered (bool)
list_item <li>
quote <blockquote>
new_line <br>
stripped <del>
separator <hr>
subscript <sub>
superscript <sup>
code <code>
generic any other element

Parsers

A parser reads input in a given format and builds an AST through the Builder.

Custom Parser

Implement the Parser interface:

Renderers

A renderer converts a NodeList into an output format.

Custom Renderer

Implement the Renderer interface:

Custom HTML Tag Mapping

The HTMLRenderer uses the Specification pattern to map block types to HTML tags. You can pass your own mapping to override the defaults:

Available specifications: BlockTypeMatch (match by type), BlockArgumentMatch (match by argument key/value), and AllMatch (compose with ->and()).

Symfony Integration

Register the bundle:

The bundle auto‑discovers all Parser and Renderer implementations (tagged isocontent.parser / isocontent.renderer) and registers a public Isocontent service. All built‑in parsers and renderers are autowired out of the box.

Two Symfony Form data transformers are also provided: ASTToStringTransformer (Node|NodeList ↔ rendered string) and ASTToArrayTransformer (Node|NodeList ↔ PHP array).

Twig Integration

A Twig filter is available to render AST directly in templates:

The filter accepts both NodeList objects and raw arrays.

Testing

CI runs on PHP 8.2, 8.3, 8.4, and 8.5 with both lowest and highest dependency versions.

Contributing

Contributions are welcome! Fork the repository, create a feature branch, ensure all checks pass, and open a pull request.

License

Isocontent is released under the MIT License.


All versions of isocontent with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package unzeroun/isocontent contains the following files

Loading the files please wait ...