Skip to content

Commit

Permalink
update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bastihilger committed Aug 22, 2021
1 parent dafe75b commit aee3d9c
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 30 deletions.
82 changes: 52 additions & 30 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,36 @@ use Manogi\Tiptap\Tiptap;
``` php
Tiptap::make('FieldName')
->buttons([
'heading',
'italic',
'bold',
'code',
'link',
'strike',
'underline',
'highlight',
'superscript',
'subscript',
'bullet_list',
'ordered_list',
'code_block',
'blockquote',
'table',
'horizontal_rule',
'edit_html'
])
->headingLevels([2, 3, 4]),
'heading',
'|',
'italic',
'bold',
'|',
'code',
'link',
'strike',
'underline',
'highlight',
'|',
'bulletList',
'orderedList',
'br',
'code_block',
'blockquote',
'|',
'horizontalRule',
'|',
'table',
'|',
'textAlign',
'|',
'image',
'|',
'history',
'|',
'editHtml',
])
->headingLevels([2, 3, 4]),
```

When just passing the string `'heading'` you will have H1, H2 and H3 to choose from. You can set the level of headings by using for example `headingLevels([2, 3, 4])` which will give you H2 through H4.
Expand All @@ -60,24 +71,39 @@ When just passing the string `'heading'` you will have H1, H2 and H3 to choose f

`'code'` is inline code (like `<code></code>`) while `'code_block'` will give you `<pre><code></code></pre>`.

## Syntax Highlighting when using `code_block`
## Syntax Highlighting when using `codeBlock`

``` php
Tiptap::make('FieldName')
->buttons([
'italic',
'bold',
'code',
'code_block'
'codeBlock'
])
->syntaxHighlighting(),
```

When using `'code_block'` you can turn on syntax highlighting by using `syntaxHighlighting()`.
When using `'codeBlock'` you can turn on syntax highlighting by using `syntaxHighlighting()`.

## Edit HTML

### Edit HTML
the `'editHtml'` option will enable the ability to toggle to the tiptap editor to a textarea and manually edit the HTML

the `'edit_html'` option will enable the ability to toggle to the tiptap editor to a textarea and manually edit the HTML
### HTML theme when using `editHtml`

``` php
Tiptap::make('FieldName')
->buttons([
'italic',
'bold',
'code',
'editHtml'
])
->htmlTheme('night'),
```

When using `'editHtml'` you can set the theme by using using `htmlTheme()`. The default theme used is "material". You can find all the codemirror themes used [here](https://codemirror.net/demo/theme.html) .

## Visibility in index view

Expand All @@ -87,15 +113,11 @@ Like `Textarea` and `Trix` fields this field is hidden from index views. You can

The tiptap editor with all the buttons:

![the tiptap editor with all the buttons](readme-images/tiptap-regular-02.png)
![the tiptap editor with all the buttons](readme-images/all-buttons.png)

The idea is that the editor can be themed together with the rest of Nova - here it is looking differently just by using the [Laravel Nova Stripe Theme](https://github.com/jameslkingsley/nova-stripe-theme):

![the tiptap editor with all the buttons](readme-images/tiptap-stripe-02.png)

## Roadmap

* Add the option to upload or choose images and add them to to the content.
![the tiptap editor with all the buttons](readme-images/stripe-theme.png)

## Licence

Expand Down
Binary file added readme-images/all-buttons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-images/stripe-theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-images/tiptap-regular-02.png
Binary file not shown.
Binary file removed readme-images/tiptap-regular-closeup.png
Binary file not shown.
Binary file removed readme-images/tiptap-stripe-02.png
Binary file not shown.
Binary file removed readme-images/tiptap-stripe.png
Binary file not shown.

0 comments on commit aee3d9c

Please sign in to comment.