File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 44[ ![ Total Downloads] ( https://poser.pugx.org/interaction-design-foundation/nova-html-code-field/downloads )] ( https://packagist.org/packages/interaction-design-foundation/nova-html-code-field )
55
66
7+ ![ image] ( https://user-images.githubusercontent.com/5278175/124833474-e7a69d80-df86-11eb-99bc-d462107d83bb.png )
8+
9+
710## ToDo
811
9121 . Add HTML validator (https://www.npmjs.com/package/html-validator )
@@ -20,10 +23,27 @@ composer require interaction-design-foundation/nova-html-code-field
2023
2124## Usage
2225
26+ ``` php
27+ public function fields()
28+ {
29+ return [
30+ HtmlCode::make('HTML content'),
31+ ];
32+ }
33+ ```
2334
2435
2536### Options
2637
38+ - ` ->styles(array array $stylesUrls) ` : optional, you can inject your custom css files.
39+ - ` ->previewTemplate(string | \Closure $template) ` : optional, wrap editable code to have even better preview.
40+
41+ Full example:
42+ ``` php
43+ HtmlCode::make('HTML content')
44+ ->styles([asset(mix('css/app.css'))]),
45+ ->previewTemplate('<section class =" panel" >%CODE%<section >')
46+ ```
2747
2848### Changelog
2949
You can’t perform that action at this time.
0 commit comments