0

In one of my __init__.py file:

description="""
This is a package for blablahblah.

It contains blahblah.
"""

The string variable is just for the purpose of usage in other modules and I don't want it to be recognized by sphinx and extracted out as documentation. Is there anyway to do it?

senshin
  • 10,022
  • 7
  • 46
  • 59
RNA
  • 146,987
  • 15
  • 52
  • 70
  • Try putting an empty string before it. Then sphinx should extract that as documentation instead. – dpk2442 Jun 14 '14 at 07:36
  • could you be a little more specific? thanks. – RNA Jun 14 '14 at 07:37
  • 1
    A quick look at the Sphinx documentation says that this shouldn't be happening. You're sure Sphinx thinks this is a docstring? – user2357112 Jun 14 '14 at 07:39
  • Sphinx uses the first string in the module as documentation. So declare an empty string before you declare the description string. Sphinx will pull out the empty string as documentation, and description will still be accessible as normal. – dpk2442 Jun 14 '14 at 07:39
  • I don't believe that Sphinx is using that as documentation. Sphinx should only use string *literals*, it doesn't look into assignments. – Bakuriu Jun 14 '14 at 07:42
  • seeing your comments, I looked at the code more carefully. It turns out that there is a hidden line adding `description` to `__doc__`. I guess that is the problem. thanks, all. – RNA Jun 14 '14 at 08:22
  • 1
    @RNA Want to make that an answer? – senshin Jun 14 '14 at 08:28

1 Answers1

0

Turns out this is caused by a stupid mistake:

One "buried" line of code added the description to the __doc__ variable.

Chris Mukherjee
  • 841
  • 9
  • 25
RNA
  • 146,987
  • 15
  • 52
  • 70