cotestatnt/esp-fs-webserver

Add more supported editor files (for example like .yaml)

erazor83 opened this issue · 3 comments

Hi there.

For a project of mine it'd be great to also allow .yaml files in the editor.

I found the corresponding part in setup-ui/extras/edit.htm .
Can you supply an unminified version too?

Thanks and have a great day!

Hi @erazor83
You should edit this file and then "repack" as byte array using the script reduce_index.sh (despite the wrong name, it works on edit.htm file)

It's not so immedetiate because the edit.htm file is minified, so the content it's not so clear at a first glance.

Anyway if you try with one of the many beatifiers that are online, in the Javascript section of the page, at one point there is a switch/case:

 switch (e.toLowerCase()) {
            case "txt":
            case "htm":
            case "html":

and you need to add the extension you are interested in.

Can you supply an unminified version too?

The file edit.htm is not mine.
It comes from one of the ESP8266 webserver library example.

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/FSBrowser/data/edit/index.htm

You could also serve directly this file from filesystem. In this way you can edit it directly online.