reStructuredText support
warning
reStructuredText support is currently limited
In addition to the support for reStructuredText Docstring Format (PEP 287), PyCharm provides an editor for restructured text.
Similarly to the Markdown editor, you can modify reStructuredText files and verify the results in the preview panel.
You can open any existing file with the restructured text or create a new one from scratch.
Right-click in the Project tool window and select New | File. In the opened dialog, specify any file name with the .rst extension and click OK.
PyCharm recognizes the file type and marks it with the corresponding icon.
The newly created file opens in the editor.
Let's add some content to see how PyCharm assists editing restructured text.
In the Settings dialog (CtrlAlt0S) , review the default color scheme for reStructuredText (Editor | Color Scheme | reStructuredText). If needed, set alternative colors and effects for markup elements.
Click OK to save the changes and close the window.
Add any section structure markup and preview the results.
Add code fragments by using the .. code-block:: directive. PyCharm supports code completion for directive names.
You can enable code syntax highlighting by specifying a particular language in the directive: .. code-block:: python. Also, ensure that your project interpreter has the Pygments package installed.
You can quickly mark up links in your text and postpone adding a reference target. PyCharm notifies you and highlights the links that lack references.
All you need is to add the proper target reference to the reStructuredText file, for example, .. _pytest: https:
/ ./docs.pytest.org/
Thanks for your feedback!