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: about 4 hours 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-11-17T06:40:26.915Z (3 days ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 15
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 "";
},
]);// $blocks - JSON состоящий из блоков-компонентов Codex Editor
$codex->render($blocks);
```
## License
MIT © [Archakov Dennis](https://github.com/Archakov06)