Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Archakov06/codex-to-html
https://github.com/Archakov06/codex-to-html
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Archakov06/codex-to-html
- Owner: Archakov06
- Created: 2019-01-20T22:32:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T16:35:36.000Z (about 4 years ago)
- Last Synced: 2024-05-20T15:40:03.684Z (6 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 16
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-editorjs - codex-to-html
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 "";
},
]);// $blocks - JSON состоящий из блоков-компонентов Codex Editor
$codex->render($blocks);
```
## License
MIT © [Archakov Dennis](https://github.com/Archakov06)