This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+tools/sphinx
Maximilian Wolff fee257b46e
[sphinx] Restore document generation/cleaning feature and document config vars
I have noticed that most commands from the sphinx layer stopped working while
I was working on the restructured text layer.

This commit tries to jurry rig this package back into a working state.
It does not solve all issues we have in this package to do so a major
rewrite would be in order.

I have fixed:
- An endless loop caused by a failing search for a conf.py
- Fixed all compile commands
- Add a more detailed description of the meaning of the necessary config
variables in the doc.
2020-02-22 11:35:59 +01:00
..
img sphinx: add sphinx logo to README 2017-02-02 15:34:44 -05:00
local/rst-sphinx [sphinx] Restore document generation/cleaning feature and document config vars 2020-02-22 11:35:59 +01:00
layers.el [core] Fix layer dependencies based on layer variables 2019-09-30 02:00:48 -04:00
packages.el [sphinx] Improve documentation and add proper command prefixes 2020-02-22 00:45:20 +01:00
README.org [sphinx] Restore document generation/cleaning feature and document config vars 2020-02-22 11:35:59 +01:00

Sphinx layer

/TakeV/spacemacs/media/commit/62e6f110bed3a3c13c8c0e76704ec0d2a2673f75/layers/+tools/sphinx/img/sphinx.png

Description

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

Features:

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

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.

Configuration

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"))))

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")

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