Open bkmeneguello opened 6 years ago
It's been a long time coming. (A very long time). But I've finally come back to this project and added the file actions to the Electron menu bar.
https://github.com/XuluWarrior/swagger-editor-offline/releases/tag/v0.2.0
So far these (mostly) mimic the ones available in the browser window. The exception being I rolled up the "convert to" logic into a choice of format in the Save As dialog.
So no "Save" option yet. And no monitoring the filesystem. I'll work on "Save" next
I think it's possible to hack into "swagger-editor" to import a file (and its dependencies) from FileSystem API, them save it to the same API. If you look at topbar.jsx#L64 'll notice that it only calls
this.props.specActions.updateSpec(YAML.safeDump(YAML.safeLoad(textFromFileLoaded)))
withtextFromFileLoaded
from the (obviously) loaded file. If you add a menu bar and implement an Electron's load file dialog and feed the editor with this data, it should be nicely integrated with local FS, then a simple "Save" action could overwrite the file and (maybe) some fsnotifier could sync the editor when some external editor changes the same content.