Download the PHP package dealnews/datocms-structured-text-to-html-string without Composer

On this page you can find all versions of the php package dealnews/datocms-structured-text-to-html-string. 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 datocms-structured-text-to-html-string

DatoCMS Structured Text to HTML String (PHP)

Convert DatoCMS Structured Text (DAST format) to HTML strings. PHP port of the official JavaScript library.

Requirements

Installation

Basic Usage

Features

Advanced Usage

Custom Text Transformation

Custom Node Rules

Change how specific node types are rendered:

Custom Mark Rules

Change how text marks (bold, italic, etc.) are rendered:

Rendering Blocks and Links

API Reference

Renderer::render($structured_text_or_node, ?RenderSettings $settings = null): ?string

Main rendering function. Converts structured text to HTML.

Parameters:

Returns: HTML string or null if input is null

Throws: RenderError if rendering fails

RenderSettings

Configuration object for customizing rendering behavior.

Properties:

Utility Functions

Rule Builders

Error Handling

The library throws RenderError exceptions when:

Default Mark Rendering

Mark HTML Tag
strong <strong>
code <code>
emphasis <em>
underline <u>
strikethrough <s>
highlight <mark>

Edge Cases

Development

Requirements

Running Tests

Running Examples

Testing

The library includes mocks-friendly dependency injection:

License

BSD 3-Clause License - see LICENSE file for details

Credits

This is a PHP port of the official DatoCMS Structured Text to HTML String JavaScript library.

Ported and maintained by DealNews.


All versions of datocms-structured-text-to-html-string with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 dealnews/datocms-structured-text-to-html-string contains the following files

Loading the files please wait ...