/sphinx.nvim

Sphinx integrations for Neovim

Primary LanguagePythonMIT LicenseMIT

sphinx.nvim

CI

Sphinx integrations for Neovim.

This plugin is still under development, some functionalities may change.

Available integrations

01 02

Source for cross-referencing roles, i.e :ref:, :doc:, py:func, etc.

Note: this plugin makes use of the inventory file from Sphinx, so you need to have built your docs at least once to get suggestions, and rebuild when your docs change to get the up to date suggestions. You can use sphinx-autobuild to rebuild your docs automatically when there is a change.

Coming soon

Installation

Install using vim-plug. Put this in your init.vim.

Plug 'stsewd/sphinx.nvim', { 'do': ':UpdateRemotePlugins' }

Note: you need to have coc.nvim installed to use the coc.nvim integration. See https://github.com/neoclide/coc.nvim/#quick-start.

Configuration

Default values are shown in the code blocks.

General settings

g:sphinx_html_output_dirs

Where to search for the local inventory file (objects.inv). The directories are relative to the conf.py file.

let g:sphinx_html_output_dirs = [
      \ '_build/html', 'build/html', '../_build/html', '../build/html',
      \ '_build/dirhtml', 'build/dirhtml', '../_build/dirhtml', '../build/dirhtml',
      \]

Intersphinx related settings

g:sphinx_include_intersphinx_data

If results should include information from Intersphinx.

let g:sphinx_include_intersphinx_data = 1

g:sphinx_doctrees_output_dirs

Where to search for the environment file (environment.pickle), this file contains the inventories from Intersphinx. The directories are relative to the conf.py file.

let g:sphinx_doctrees_output_dirs = [
      \ '_build/doctrees', 'build/doctrees', '../_build/doctrees', '../build/doctrees',
      \ '_build/html/.doctrees', 'build/html/.doctrees', '../_build/html/.doctrees', '../build/html/.doctrees',
      \ '_build/dirhtml/.doctrees', 'build/dirhtml/.doctrees', '../_build/dirhtml/.doctrees', '../build/dirhtml/.doctrees',
      \]

g:sphinx_always_use_scoped_targets

Always prefix the reference with the name of the target, i.e use :ref:`<python:comparisons>` instead of :ref:`<comparisons>` to link to the label “comparisons” in the doc set “python”.

let g:sphinx_always_use_scoped_targets = 1