Open Kiloneie opened 1 year ago
I'm not sure how this would be done, nimib would somehow have to know that a browser has the file open and then somehow request the browser to reload the page. I'm not sure if that's possible (in a simple, portable way for all browsers). There are options for you, though:
--nbShow
on the first run and then run without it the subsequent times and reload the same page it previously opened manually.--nbShow
) the file, the server will notice that the HTML file has been changed and reload the page automatically for you.Live Server extension works exactly how i wanted it, thank you.
in principle I think there should be a way to this in nimib without relying on an external plugin. We would need to serve the file through localhost, watch for changes and serve again. not sure if a runtime option is the best way* to do that (if it is I might want to call it --nbServe
), but I guess we could keep open this issue for further brainstorming.
An automatic reload is indeed something missing in nimib that would help iterating on a document. I do not use that extension (nice to know it exists) and end up having tons of tabs open...
*although I cannot resist thinking how to implement this with a runtime option:
--nbServe
is given then after saving the html instead of opening the browser the system should launch a small (nim) webserver that serves the static file and watches for changesCan we run a small local server with node.js maybe ? Github uses Jekyll (Ruby). I am not sure if we should add them as a dependency. We can simply recommend users to use their favorite one and give some examples in the README.md. It is still more a comfort feature than something mandatory. I am attached to a low count of packages and dependencies.
Defintely not with nodejs ;), but likely with a simple Nim server like nimhttpd + some watch mechanism. I am not sure if this use case warrants for something more than that.
Currently nbShow opens the file in the browser after c -r, but it does not care if it is already opened, so it always opens up a new instance. Would it be possible to have a nbReload option that would reload the page instead ? Or even open the page if it's not open, and then reload on it's subsequent runs ?