I'm using Sphinx to generate HTML documentation. Everything works great but for some reason, the source code and comments in the generated HTML file are really outdated. I don't even understand how it's possible. I've deleted all files multiple times and generated it again and still the same issue.
Asked
Active
Viewed 498 times
2
-
Did you also delete all output files, including the `.doctree` pickles? https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-d – mzjn Jan 27 '21 at 19:22
-
Yes. I've deleted all .doctree files in the /docs folder and it didn't help.. then I deleted the docs folder completely and started from scratch and still the same weird output. is it possible it keeps the cache outside of the /docs folder? – Arman Avetisyan Jan 27 '21 at 20:03
-
You do not need to delete .rst files ever. Try `make clean && make html`. Also verify that what you have configured in your `conf.py` for the html build directory is where you expect it to be. Finally if that does not yield expected results, then delete the build directory only, and try again. Cache is stored only in the build directory, so when you delete it, so goes the cache. – Steve Piercy Jan 28 '21 at 08:11
-
yep. this is really weird. because I did delete the build and it didn't help.. then I delete everything start from scratch and the same thing. Can't even understand how it's giving me HTML output with some lines that don't exist in my .py files anymore. that's why I think it's a cache issue but outside of the build directory. just FYI. I'm using pycharm and git. Not sure how but is it possible this has something to do with ide and git? – Arman Avetisyan Jan 28 '21 at 14:36
2 Answers
2
I had the exact same problem. In my case, I had an older version of the package that I was documenting installed via pip and that was the source that sphinx was using to build the docs. Removing the old version with
pip uninstall <my_pkgname>
solved the issue.

Maniche
- 73
- 7
0
Are you using autodoc
extension alongside with sphinx-apidoc
util?
If so, then you may want to re-generate the content of doc/source
in your package, considering that the documentation is in docs
directory.
$ cd docs
$ rm -r source
$ sphinx-apidoc -o source ../<package_name>
Here ../<package_name>
is used to provide a path to the package content.

Maxim Ivanov
- 299
- 1
- 6
-
Thanks for the answer Maxim. yes, I use the extension and sphinx-apidoc. And I've already done this too but still the same issue. I think something is related to cache. because source files contents are completely different but still it gets comments from that don't exist for a very long time. Do you have any suggestions where it can keep cache or soemthing like that? – Arman Avetisyan Jan 27 '21 at 19:11