Skip to content

Commit 3373565

Browse files
committed
Improve docs in readme
1 parent f9e00e4 commit 3373565

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
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

912
1. 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

0 commit comments

Comments
 (0)