2

Sorry, I am a newbie trying to add Sphinx to auto-generate documentation for a Django project and also ensure sufficient documentation coverage of the project.

I want to configure Sphinx to tell me which Objects are missing documentation by using the coverage_show_missing_items flag, specified here:
https://www.sphinx-doc.org/ar/master/usage/extensions/coverage.html#confval-coverage_show_missing_items

Unfortunately, I have not been able to figure out where/how to set this configuration. My Google-fu didn't come up with any examples on how to configure these settings.

I'm guessing it should go inside conf.py somewhere, but haven't come across any examples on how to do it.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Zhao Li
  • 4,936
  • 8
  • 33
  • 51

1 Answers1

2

With almost every Sphinx extension, one may configure options either in conf.py or the command line. For your case, put this somewhere in your conf.py where you see extensions:

extensions = [
    # Other extensions that you might already use
    # ...
    'sphinx.ext.coverage',
]

# ...
# Configuration of sphinx.ext.coverage
coverage_show_missing_items = True
Yogev Neumann
  • 2,099
  • 2
  • 13
  • 24
Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
  • Thanks Steve. I should have guessed that it is just regular Python code. – Zhao Li Jan 29 '21 at 16:59
  • Just curious and maybe you know, but the coverage extension still isn't telling me which classes are not documented in `docs/build/python.txt` – Zhao Li Jan 29 '21 at 16:59
  • Is there another setting that I should use to have Sphinx tell me which classes need to be documented or output a coverage percentage? – Zhao Li Jan 29 '21 at 17:00
  • I'd be happy to post another question if that's easier for you :) – Zhao Li Jan 29 '21 at 17:00
  • 1
    in case it's useful, I'm running sphinx with: `sphinx-build -b coverage docs/source/ docs/build/` – Zhao Li Jan 29 '21 at 17:01
  • I have no idea. The documentation is sparse. I would run it through a debugger and put breakpoints in the source of https://www.sphinx-doc.org/en/master/_modules/sphinx/ext/coverage.html#CoverageBuilder – Steve Piercy Jan 30 '21 at 09:29