-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: local webapp with filewatch #20
Comments
Hey there, that's a reasonable use case. You can get the web app running locally by installing the dependencies with If I were you, I'd set up a file watcher like entr to automatically call echo keymap.yaml | entr -s 'keymap draw keymap.yaml >keymap.svg' Then you could set up a separate one to open the browser (or another svg viewer), the -r flag should help to not create a new window/tab every time: echo keymap.svg | entr -r firefox keymap.svg (Note I haven't tested above since I don't have computer access for a few days.) I think a |
Thanks! That's actually a better solution than firing up the webapp, because that UI doesn't make sense anyway for this usecase, just displaying the svg is better. The solution works great except it opens in a new tab in firefox for each update, I'm not sure there's a way around that, looking at the command line flags for firefox. Using something like https://github.com/lepture/python-livereload might be necessary to get autoreload working, I actually tried that but it unsurprisingly does not work when viewing svg-files. I'm guessing wrapping it an html page would do the trick. So another solution that would probably be doable in 10 lines of code is adding the livereload module or similar to create a serve-command. I'm guessing there's also a firefox extension that would allow autoreload of local files, so that's another option. |
Great, opening a new tab everytime sounds annoying but you could replace that second part with an autoreload plugin indeed. Thanks for the pointer to livereload, I can play around with that a bit when I get a chance. (PRs are also welcome!) |
I'm currently using the keymap-drawer webapp to design a new layout, which is very nice, but I would love to be able to start a local webapp pointing to the yaml-file, so I can edit it in an editor, and it would refresh on save. Because the online yaml-editor is a bit annoying to use for this usecase.
For example:
I might even give this a go myself if you could provide some pointers on where to start in getting the app up and running locally.
The text was updated successfully, but these errors were encountered: