Sphinx Completion

Answered

I've found some posts and looked through related issues (hinted from this post:  https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000784044-Sphinx-with-PyCharm), however, I'm still unclear if there is any support for auto complete.

For Sphinx, it would be great if there was some kind of auto completion for :ref:, :class: and similar.

I'm in the process of working out how I want to structure my documentation (not just doc strings, but detailed docs) and we already use Confluence a lot (which makes things like tables and links to other pages super easy).  I'd love to have something similar in PyCharms with Sphinx at least for cross referencing documentation (code too would be great, but that's lower priority).

I'm interested enough that if the feature doesn't exist, I might try develop it as a plugin, but wouldn't mind some pointers to doing that.

4 comments

Just to be clear, you're looking for autocompletion on directives in RST docs themselves, right? Not on things like Jinja2 templates that format a docs project or in Python code for Sphinx extensions.

0

Yes, mainly within the RST files within the docs folder.  However, when testing  cross references to other python objects within doc strings, there doesn't appear to be any existing automation in PyCharms.  The only automation I see is the completion of :param: and :type: (both very handy, especially the shortcut with """).

For instance, the Django integration is excellent, with PyCharms already to assist in auto completion of reverse urls, template paths, static file paths, installed apps and so forth.  Having the same capability for ReST would be really awesome and make cross-referencing and building documentation and manuals a lot less prone to error.

 

0

I believe this ticket PY-6275 describes what you're looking for. Despite being old, it only has a couple of votes.

0

My company uses Sphinx extensively and all members of my team use PyCharm exclusively.  This would be a killer feature.

0

Please sign in to leave a comment.