Table of Contents

Sphinx layer

Table of ContentsClose

sphinx.png

1. Description

The layer adds support for the documentation generation system Sphinx to the restructuredtext layer.

1.1. Features:

  • Support for Sphinx project compilation
  • Support for opening Sphinx project target
  • Support for opening Sphinx config file

2. Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add sphinx to the existing dotspacemacs-configuration-layers list in this file.

3. Configuration

3.1. Sphinx target

To use the layer's Sphinx feature, the following variables should be set.

A parent directory is needed for all your Sphinx project builds:

(sphinx :variables
        rst-sphinx-target-parent "~/MyProjects/")

Create a directory in the parent directory for each Sphinx project. This will be used as the project name for the layer. In addition you need to define where the output folder should be for each project.

(sphinx :variables
        rst-sphinx-target-parent "~/MyProjects/"
        rst-sphinx-target-projects
        '(("project1" . (latex "project1/_build"))
          ("project2" . (html  "project2/_build"))))

3.2. Web browser

Set the browser for viewing the HTML page of current rst file. This one is optional. If not set, the default browser will be used.

(sphinx :variables
        rst-slides-program "chromium")

4. Key bindings

Key binding Description
SPC m c c compile projects
SPC m c C clean projects
SPC m c r rebuild projects
SPC m g c open conf.py of current project
SPC m o open compiled HTML page of current page

Author: root

Created: 2024-04-03 Wed 19:40

Validate