1

I'm new to Sphinx and I'm trying to build documentation for myPackage. I have the folder structure below. MyFile.py includes the relevant docstrings. I generate documentation using make html but it does not show data about mySubPackage, I would appreciate any hint.

|____myPackage
| |____mySubPackage
| | |____MyFile.py
| | |______init__.py
| |______init__.py
|____docs
| |____index.rst
| |_____templates
| |____Makefile
| |____conf.py
| |_____static
| |____make.bat
| |_____build
bad_coder
  • 11,289
  • 20
  • 44
  • 72
Tom Ron
  • 5,906
  • 3
  • 22
  • 38
  • Did you execute [sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) command before make? – pjk Nov 27 '20 at 08:14
  • No, I would have a look, thanks for the hint (I had a look on the standard tutorials and it was not mentioned there) – Tom Ron Nov 27 '20 at 08:40
  • Depending if you are using a [`/src` layout](https://stackoverflow.com/a/60159862) or a [simple layout](https://stackoverflow.com/a/59951675) the detailed steps in those posts should get you going together with the official ["Getting Started"](https://www.sphinx-doc.org/en/master/usage/quickstart.html) guide. From the files you are showing I recommend choosing *"Separate sources from build directories"* when running `sphinx-quickstart` and indeed, you haven't yet generated `.rst` files using `sphinx-apidoc`. – bad_coder Nov 27 '20 at 09:28
  • 1
    @bad_coder thanks, I dag into the "sphinx_apidoc" but eventually ended up doing exactly the things described in the post you linked to. – Tom Ron Nov 27 '20 at 09:31
  • @TomRon Let us know if you need anything more (some layouts require a bit more elaboration). `sphinx-apidoc` using default settings will generate one `.rst` file per package that contains one `.. automodule::` for each module in the package (and one extra `.. automodule` for the package itself). – bad_coder Nov 27 '20 at 09:34
  • I could generate with how it is explained here https://www.youtube.com/watch?v=qrcj7sVuvUA&t=704s – pjk Nov 27 '20 at 10:00

0 Answers0