Skip to content
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

Autoreload on code changes #31

Closed
jacobsvante opened this issue Jun 11, 2015 · 10 comments
Closed

Autoreload on code changes #31

jacobsvante opened this issue Jun 11, 2015 · 10 comments

Comments

@jacobsvante
Copy link

First of all, thanks for a great project.

One thing that would be awesome is if sphinx-autobuild . _build/html could also include checking if code has been updated for my project. Right now the autodoc parts of my documentation is not reflected when the docstrings change in the code. What do you think? Would this be possible to implement?

@GaretJax
Copy link
Contributor

Hi Jacob, this should already be implemented, you have to manually add the directory to watch using the correct flag.

Best,Jonathan

Apologies for any cryptic brevity or errors; this message was composed on a mobile device.

On Thu, Jun 11, 2015 at 8:05 PM, Jacob Magnusson notifications@github.com
wrote:

First of all, thanks for a great project.

One thing that would be awesome is if sphinx-autobuild . _build/html could also include checking if code has been updated for my project. Right now the autodoc parts of my documentation is not reflected when the docstrings change in the code. What do you think? Would this be possible to implement?

Reply to this email directly or view it on GitHub:
#31

@jacobsvante
Copy link
Author

Indeed it did. Can't help but feel a bit stupid. Thanks!

@GaretJax
Copy link
Contributor

No problem. Have fun using the tool. :-)

@jacobsvante
Copy link
Author

Thanks!

I wonder though.. Why doesn't it also build the code when starting up? Having to run sphinx-build before with basically the same arguments feels a bit "pancake on pancake" like we say in Sweden 😄

@GaretJax
Copy link
Contributor

I don't get the question. Could you show me what you're trying to achieve?

Best,Jonathan

Apologies for any cryptic brevity or errors; this message was composed on a mobile device.

On Fri, Jun 12, 2015 at 1:49 AM, Jacob Magnusson notifications@github.com
wrote:

Thanks!

I wonder though.. Why doesn't it also build the code when starting up? Having to run sphinx-build before with basically the same arguments feels a bit "pancake on pancake" like we say in Sweden 😄

Reply to this email directly or view it on GitHub:
#31 (comment)

@jacobsvante
Copy link
Author

$ cd docs
$ rm -rf _build
$ sphinx-autobuild -z ../flask_resize . _build/html
[I 150612 01:52:21 server:271] Serving on http://127.0.0.1:8000
[I 150612 01:52:21 handlers:58] Start watching changes
[I 150612 01:52:21 handlers:60] Start detecting changes

It doesn't build the docs.

Instead I have to do:

$ cd docs
$ rm -rf _build
$ sphinx-build . _build/html
Running Sphinx v1.3.1
making output directory...
loading pickled environment... not yet created
[...]
$ sphinx-autobuild -z ../flask_resize . _build/html
[I 150612 01:52:21 server:271] Serving on http://127.0.0.1:8000
[I 150612 01:52:21 handlers:58] Start watching changes
[I 150612 01:52:21 handlers:60] Start detecting changes

@GaretJax
Copy link
Contributor

Oh, now I got it. Sorry it's late.

You're right, that could be useful and would also be easy to implement. Feel free to open an issue for that (or a PR :-).

@jacobsvante
Copy link
Author

Might do it when I get some more spare time... What do you think, should the docs be re-built by default?

@GaretJax
Copy link
Contributor

Yes, I would do it by default, with a switch to turn it off.

@rouge8
Copy link

rouge8 commented Sep 4, 2015

@GaretJax this doesn't seem to work for me? When I save, it triggers the rebuild as expected, but the built content is not actually changed.

Command:

sphinx-autobuild -E -a -z /Users/rouge8/rj/fathom-assets/fathom_assets -n -b html -d /Users/rouge8/rj/fathom-assets/.tox/docs-dev/tmp/doctrees . _build/html

Output:

+--------- ../fathom_assets/query/managers.py changed ---------------------------
| Running Sphinx v1.3.1
| loading intersphinx inventory from https://docs.python.org/2.7/objects.inv...
| building [mo]: all of 0 po files
| building [html]: all source files
| updating environment: 3 added, 0 changed, 0 removed
| reading sources... [ 33%] api
| reading sources... [ 66%] index
| reading sources... [100%] queries
|
| looking for now-outdated files... none found
| pickling environment... done
| checking consistency... done
| preparing documents... done
| writing output... [ 33%] api
| writing output... [ 66%] index
| writing output... [100%] queries
|
| generating indices... genindex py-modindex
| highlighting module code... [ 25%] fathom_assets.query.managers
| highlighting module code... [ 50%] fathom_assets.query.terms
| highlighting module code... [ 75%] fathom_assets.query.query
| highlighting module code... [100%] fathom_assets.query.nodes
|
| writing additional pages... search
| copying static files... done
| copying extra files... done
| dumping search index in English (code: en) ... done
| dumping object inventory... done
| build succeeded.
+--------------------------------------------------------------------------------


+--------- ../fathom_assets/query/managers.py changed ---------------------------
| Running Sphinx v1.3.1
| loading intersphinx inventory from https://docs.python.org/2.7/objects.inv...
| building [mo]: all of 0 po files
| building [html]: all source files
| updating environment: 3 added, 0 changed, 0 removed
| reading sources... [ 33%] api
| reading sources... [ 66%] index
| reading sources... [100%] queries
|
| looking for now-outdated files... none found
| pickling environment... done
| checking consistency... done
| preparing documents... done
| writing output... [ 33%] api
| writing output... [ 66%] index
| writing output... [100%] queries
|
| generating indices... genindex py-modindex
| highlighting module code... [ 25%] fathom_assets.query.managers
| highlighting module code... [ 50%] fathom_assets.query.terms
| highlighting module code... [ 75%] fathom_assets.query.query
| highlighting module code... [100%] fathom_assets.query.nodes
|
| writing additional pages... search
| copying static files... done
| copying extra files... done
| dumping search index in English (code: en) ... done
| dumping object inventory... done
| build succeeded.
+--------------------------------------------------------------------------------

[I 150904 01:55:34 handlers:91] Reload 1 waiters: None
[I 150904 01:55:34 handlers:131] Browser Connected: http://127.0.0.1:8000/api.html#module-fathom_assets.query.managers

return42 added a commit to return42/sphinx-autobuild that referenced this issue May 30, 2024
To update changes to the doc strings (autodoc) in the source code in the HTML
output, the sphinx-build must not run in the same process as the server /
sphinx-build must run in a subprocess so that changed source code is
re-imported.

This issue was introduced in commit d57f117 / a commit without a PR & review.

Related: sphinx-doc#31 (comment)
Closes: sphinx-doc#148

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/sphinx-autobuild that referenced this issue May 30, 2024
To update changes to the doc strings (autodoc) in the source code in the HTML
output, the sphinx-build must not run in the same process as the server /
sphinx-build must run in a subprocess so that changed source code is
re-imported.

This issue was introduced in commit d57f117 / a commit without a PR & review.

Related: sphinx-doc#31 (comment)
Closes: sphinx-doc#148

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/sphinx-autobuild that referenced this issue May 30, 2024
To update changes to the doc strings (autodoc) in the source code in the HTML
output, the sphinx-build must not run in the same process as the server /
sphinx-build must run in a subprocess so that changed source code is
re-imported.

This issue was introduced in commit d57f117 / a commit without a PR & review.

Related: sphinx-doc#31 (comment)
Closes: sphinx-doc#148

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/sphinx-autobuild that referenced this issue Sep 3, 2024
To update changes to the doc strings (autodoc) in the source code in the HTML
output, the sphinx-build must not run in the same process as the server /
sphinx-build must run in a subprocess so that changed source code is
re-imported.

This issue was introduced in commit d57f117 / a commit without a PR & review.

Related: sphinx-doc#31 (comment)
Closes: sphinx-doc#148

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants