Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Archakov06/codex-to-html


https://github.com/Archakov06/codex-to-html

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Codex To HTML

Class for converting JSON-blocks EditorJS to HTML.

## How to use?

Create an instance of the class with prepared settings for each block and call the `render` method (put JSON-blocks).

## Example

```php
function($html) {
return $html;
},
'header' => function($text, $level) {
return "${text}";
},
'paragraph' => function($text) {
return "

{$text}

";
},
'image' => function($file, $caption, $widthBorder, $stretched, $withBackground) {
return "\"{$caption}\"";
},
]);

// $blocks - JSON состоящий из блоков-компонентов Codex Editor

$codex->render($blocks);

```

## License

MIT © [Archakov Dennis](https://github.com/Archakov06)