title: How can I document a constant (module level variable) with sphinx (docstring without data)?
body: <p>I want to document a constant by its docstring. I don't want to let the value to show up. If I have a long list, Sphinx will include it completely which I don't want. It would be okay for me if only an excerpt would be shown (with ellipsis or whatever). But not thousands of list elements.</p>
  
  <pre><code>module_level_variable2 = 98765
  """int: Module level variable documented inline.
  
  The docstring may span multiple lines. The type may optionally be specified
  on the first line, separated by a colon.
  """
  </code></pre>
  
  <p>I've tried the following:</p>
  
  <pre><code>.. autoclass:: module_level_variable2
  </code></pre>
  
  <p>does not show the docstring at all.</p>
  
  <pre><code>.. autodata:: module_level_variable2
  </code></pre>
  
  <p>does show docstring and the data.</p>
  
  <pre><code>.. automethod:: module_level_variable2
  </code></pre>
  
  <p>and
      .. autoattribute:: module_level_variable2</p>
  
  <p>do not show anything in the documentation (not even the name of the variable).</p>
  
  <pre><code>.. autofunction:: module_level_variable2
  </code></pre>
  
  <p>does show the docstring only. This is almost what I want. However, it considers a constant as a function() by adding parentheses to it - which is wrong (why a warning is raised on <code>make html</code>!</p>
  
  <p>I went through <a href="http://www.sphinx-doc.org/en/1.4.8/ext/autodoc.html" rel="noreferrer">http://www.sphinx-doc.org/en/1.4.8/ext/autodoc.html</a> but could not find a switch to tell <code>.. autodata::</code> not to show the data itself (but the docstring only).</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <pre><code>.. autodata:: module_level_variable2
     :annotation:
  </code></pre>