This package provides a reStructuredText back-end for Emacs Xref.
This means you can look-up links at the cursor as well as finding references to link-targets.
Available via melpa.
For large multi-file projects, being able to jump to links can be useful.
Once enabled, the following Xref functions can be used with RST files.
xref-find-definitionsLook up the symbol at the cursor.
Supports
ref,term,docand file-paths (in anindexfor example).xref-find-referencesShows references to a target when the cursor is over one.
Supports
reftargets and terms in theglossary.
This can be enabled using xref-rst-mode (a buffer-local minor-mode), for example:
(add-hook 'rst-mode-hook #'xref-rst-mode)rst-find-in-project-extensions('(".rst" ".txt"))- A list of literal file extensions to search.
- The projects root is detected by searching for
conf.py(used by Sphinx), otherwise version control is used to find the root. - Files and directories beginning with a
.are ignored. - The
xref-rst-modeminor mode simply handles adding/removing theXrefback-end.