title: Automatically Generating Documentation for All Python Package Contents
body: <p>I'm trying to auto-generate basic documentation for my codebase using Sphinx. However, I'm having difficulty instructing Sphinx to recursively scan my files.</p>
  <p>I have a Python codebase with a folder structure like:</p>
  <pre><code>&lt;workspace&gt;
  └── src
      └── mypackage
          ├── __init__.py
          │   
          ├── subpackageA
          │   ├── __init__.py
          │   ├── submoduleA1
          │   └── submoduleA2
          │   
          └── subpackageB
              ├── __init__.py
              ├── submoduleB1
              └── submoduleB2
  </code></pre>
  <p>I ran sphinx-quickstart in <code>&lt;workspace&gt;</code>, so now my structure looks like:</p>
  <pre><code>&lt;workspace&gt;
  ├── src
  │   └── mypackage
  │       ├── __init__.py
  │       │
  │       ├── subpackageA
  │       │   ├── __init__.py
  │       │   ├── submoduleA1
  │       │   └── submoduleA2
  │       │
  │       └── subpackageB
  │           ├── __init__.py
  │           ├── submoduleB1
  │           └── ubmoduleB2
  │
  ├── index.rst
  ├── _build
  ├── _static
  └── _templates  
  </code></pre>
  <p>I've read the <a href="https://www.sphinx-doc.org/en/master/usage/quickstart.html" rel="nofollow noreferrer">quickstart tutorial</a>, and although I'm still trying to understand the docs, the way it's worded makes me concerned that Sphinx assumes I'm going to manually create documentation files for every single module/class/function in my codebase.</p>
  <p>However, I did notice the &quot;automodule&quot; statement, and I enabled autodoc during quickstart, so I'm hoping most of the documentation can be automatically generated. I modified my conf.py to add my src folder to sys.path and then modified my index.rst to use automodule. So now my index.rst looks like:</p>
  <pre><code>Contents:
  
  .. toctree::
     :maxdepth: 2
  
  Indices and tables
  ==================
  
  * :ref:`genindex`
  * :ref:`modindex`
  * :ref:`search`
  
  .. automodule:: alphabuyer
     :members:
  </code></pre>
  <p>I have dozens of classes and functions defined in the subpackages. Yet, when I run:</p>
  <pre><code>sphinx-build -b html . ./_build
  </code></pre>
  <p>it reports:</p>
  <pre><code>updating environment: 1 added, 0 changed, 0 removed
  </code></pre>
  <p>And this appears to have failed to import anything inside my package. Viewing the generated index.html shows nothing next to &quot;Contents:&quot;. The Index page only shows &quot;mypackage (module)&quot;, but clicking it shows it also has no contents.</p>
  <p>How do you direct Sphinx to recursively parse a package and automatically generate documentation for every class/method/function it encounters, without having to manually list every class yourself?</p>