Is there any way to add a button for prism in summernote editor?
I have prism css and js file included in my view but i don't know how to add button for it in editor:
$(document).ready(function() {
$('.summernote').summernote({
minHeight: 200,
toolbar: [
['style', ['style', 'bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize', 'fontname', 'fontsizeunit', 'height']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'emoji', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
});
});
Any idea?
If you look on the main Summernote website as opposed to the API docs you will see a clear example, that explains how to customise the toolbar. It is on the Deep Dive page and scroll down to Custom Toolbar. It also lists the available toolbar buttons. In your toolbar you set ['style', ['bold', 'italic',...
First, download the minified precompiled version of Summernote from the official website. Extract it & place it in the current working folder. Create an index. html file & declare the Bootstrap & jQuery links inside the <head> tag.
I fixed my issue by creating a plugin for summernote as well as package for others to use
editor
view
NPM
GitHub
Hope it help others as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With