PyCharm 3.1.0 Web Help

PyCharm provides convenient features for creating documentation comments.

In this part:

Prerequisites

Python docstrings

Note

Before you start, make sure that epytext or reStructuredText is selected in the Python Integrated Tools page.

Also note that PyCharm captures custom roles from conf.py. When configuring the directory that contains *.rst files, point to the directory with conf.py (Python Integrated Tools | Path to the directory with *.rst files).

Basics

In languages files, PyCharm creates stubs of documentation comments on typing the opening tag and pressing EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.

If this feature applies to a function, PyCharm generates tags, depending on the selected docstring format:

  • For reStructuredText: :param tags for each parameter declared in the function signature, and :return tag.
  • For Epytext: @param tags for each parameter declared in the function signature, and @return tag.
So doing, the tags in reStructuredText and epytext markup are highlighted accordingly.

If configured, the documentation comment stubs can be generated with type and rtype tags.

When you create additional tags, PyCharm provides code completion that suggests the possible tag names.

Note

Documentation comments in your source code are available for the Quick Documentation Lookup and open for review on pressing Ctrl+Q or Alt+Button2 ClickCtrl+Q or Alt+Button2 ClickCtrl+Q or Alt+Button2 ClickCtrl+Q or Alt+Button2 ClickCtrl+Q or Alt+Button2 ClickCtrl+QCtrl+Q or Alt+Button2 ClickAlt+Button2 Click, Ctrl+Shift+Space or F2F1, Control J or Control Button2 ClickControl J or Control Button2 ClickAlt Button2 Click or F2.

See Also

Procedures:

Web Resources: