21

I have a module with two documented global special-members.

Running Sphinx locally creates documentation that includes their docs, but Read the Docs doesn't. It uses the built-in type's documentation instead.

I have tried both styles: #: and docstring after the definition. I have read autodoc's documentation multiple times, and the Read the Docs entry on it. I can't figure out what I'm missing, as I don't even see any build errors on Read the Docs.

Any ideas?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Márcio
  • 677
  • 8
  • 15
  • can you show the full command you are using to build doc? – Assem Sep 03 '15 at 10:27
  • From https://readthedocs.org/projects/argf/builds/3296530/: `python /home/docs/checkouts/readthedocs.org/user_builds/argf/envs/latest/bin/sphinx-build -T -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html` – Márcio Sep 03 '15 at 20:19
  • I was going to come in here and tell you the same way you do in `sphynx`, with `#:` immediatly before the member ... but it looks like you have already tried that, so instead have a +1 in the hopes that you get a good answer :) – Joran Beasley Sep 08 '15 at 15:40
  • Possibly you're using a different version from the one RTD uses. Looks like there are some bugs with special-members in various releases. See https://github.com/sphinx-doc/sphinx/issues?q=Autodoc+special – Peter Brittain Apr 21 '16 at 22:37

1 Answers1

2

In case you are using Napoleon extension to handle NumPy or Google style docstrings, you can set a configuration flag for this in your conf.py

http://sphinx-doc.org/ext/napoleon.html?highlight=special#confval-napoleon_include_special_with_doc

If I remember correctly there is also a directive for autodoc:

http://sphinx-doc.org/ext/autodoc.html?highlight=member#event-autodoc-skip-member

By implementing this method you have a fine grained choice of which member is going to be included in the docs and which is not.

marscher
  • 800
  • 1
  • 5
  • 22