You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • @neshanjo
    A simple example how to add a formatter.
    I used beautifier, because its so easy to add.
    And it does not need an internet connection.

    • add a file to js/plugins with following code
    • add a script tag in main.html to the new plugin
    • add beautify folder in js/libs
    • add beautify-file from github into this new folder
    • add script tag in main.html to beautify-file

      "use strict";
      var iconFolder;
      function init() {
      function showIcon(){
        iconFolder = Espruino.Core.App.addIcon({
          id: 'formatCode',icon: 'snippets',title: 'Prettyfie',order: 510,
          area: { name: "code",position: "top"},
          click: prettyfie
      function prettyfie(){
         var code = Espruino.Core.EditorJavaScript.getCode()­;
         code = js_beautify(code);
      Espruino.Plugins.FormatCode = {
        init : init,  



Avatar for JumJum @JumJum started