dldl / sphinx-preview

Sphinx preview in Atom
MIT License
5 stars 4 forks source link

Multi-project folders do not work #13

Closed andreycizov closed 5 years ago

andreycizov commented 5 years ago

If I've got two project folders added with two different roots of restructuredtext docs and I open one of them in the preview - then there's no way to go back and open the preview for the other one.

andreycizov commented 5 years ago

On that matter - I am not particularly familiar with the Atom plugin development, but I think the cheapest way to solve this issue is to simply stop treating the docker container as a singleton, but rather assign a label to the container generated from the project folder, or the file opened in the editor. Then generate a separate port number for them and open that in the preview pane.

quentinus95 commented 5 years ago

This is blocked by #11 and due to the limitation outlined in dldl/sphinx-server#13.

andreycizov commented 5 years ago

I have tried my multi-document-multi-project version of the plugin with the newer version of dldl/sphinx-server, but I can't fix one issue: somehow the sphinx-server returns the same Etag for every version of the document it's rendering, so the browser used inside this plugin assumes the content hasn't changed so never reloads it.

Have you ever managed to fix it somehow for the previous version?

quentinus95 commented 5 years ago

Your issue may be a duplicate of #2 and #14.

hileef commented 5 years ago

but I can't fix one issue: somehow the sphinx-server returns the same Etag for every version of the document it's rendering, so the browser used inside this plugin assumes the content hasn't changed so never reloads it.

This is indeed a duplicate of #2 .

andreycizov commented 5 years ago

I had just got a merge in https://github.com/lepture/python-livereload/pull/192 that rechecks mtimes of the files every time they are accessed.

Can someone test this in their environment?

Also, would be great if after this we could release the newer version of the plugin, so that it would be available in the plugin repo.

quentinus95 commented 5 years ago

Releasing a new version of the plugin should not be necessary, as this feature is provided by sphinx-server. We just need to wait for a new python-livereload release. I'll then generate a new image on Docker Hub.

andreycizov commented 5 years ago

https://github.com/lepture/python-livereload/commit/db0c52d519f3a67bef19a1905a1cca5c7523e27d

Sphinx-server should now be ready for release!

quentinus95 commented 5 years ago

@andreycizov I've just triggered a new build for sphinx-server latest. You should be able to pull it now. It uses livereload 2.6.1.

Please tell me if it solves your issue so we can close it.

andreycizov commented 5 years ago

Releasing a new version of the plugin should not be necessary, as this feature is provided by sphinx-server. We just need to wait for a new python-livereload release. I'll then generate a new image on Docker Hub.

@quentinus95 It's not necessary, but I had submitted commits that depend on the latest sphinx-server. The latest version of this plugin in the Atom repo is 0.1.3 which predates my (already merged) pull request. Is there any reason you're not willing to release it?

quentinus95 commented 5 years ago

Sorry for that, I'll review and release a new version asap.

andreycizov commented 5 years ago

@quentinus95 thanks a lot!

quentinus95 commented 5 years ago

0.1.4 released.