@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. Steps:
add script tag in main.html to beautify-file
"use strict"; (function(){ var iconFolder; function init() { showIcon(); } 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.Core.EditorJavaScript.setCode(code); } Espruino.Plugins.FormatCode = { init : init, }; }());
```
@JumJum started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@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.
Steps:
add script tag in main.html to beautify-file
```