We’re moving NixMash Spring Posts to the Summernote WSYWYG Editor. We went with Summernote because it is relatively lightweight, easily customized, and supports not only Bootstrap but Bootswatch as well. NixMash Spring uses the United Bootswatch theme, so that was another win in going with Summernote. Here’s a screenshot of the editor in action.
So we need buttons to generate the above HTML in the Editor.
Being control freaks we define exactly which buttons we want to see and remove those we don’t need. We add our custom “codebuttons” at the bottom of the code block.
Finally we use an addCodeBlock() function to add the <PRE> and <CODE> DOM Elements to the editor.
And the payoff.