2017-02-02 19:55:18 +00:00
|
|
|
#+TITLE: Sphinx layer
|
|
|
|
|
2019-05-02 21:49:30 +00:00
|
|
|
#+TAGS: layer|tool
|
|
|
|
|
2017-02-02 19:55:18 +00:00
|
|
|
[[file:img/sphinx.png]]
|
|
|
|
|
2019-05-07 20:05:06 +00:00
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
2017-12-15 16:40:39 +00:00
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#configuration][Configuration]]
|
|
|
|
- [[#sphinx-target][Sphinx target]]
|
|
|
|
- [[#web-browser][Web browser]]
|
|
|
|
- [[#key-bindings][Key bindings]]
|
2017-02-02 19:55:18 +00:00
|
|
|
|
|
|
|
* Description
|
2017-12-15 16:40:39 +00:00
|
|
|
The layer adds support for the documentation generation system =Sphinx= to
|
2017-02-02 19:55:18 +00:00
|
|
|
the =restructuredtext= layer.
|
|
|
|
|
2017-12-15 16:40:39 +00:00
|
|
|
** Features:
|
|
|
|
- Support for =Sphinx= project compilation
|
|
|
|
- Support for opening =Sphinx= project target
|
|
|
|
- Support for opening =Sphinx= config file
|
|
|
|
|
2017-02-02 19:55:18 +00:00
|
|
|
* 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
|
2019-05-26 20:58:52 +00:00
|
|
|
To use the layer's Sphinx feature, the following variables should be set.
|
2017-02-02 19:55:18 +00:00
|
|
|
|
2020-02-22 10:35:59 +00:00
|
|
|
A parent directory is needed for all your Sphinx project builds:
|
2017-02-02 19:55:18 +00:00
|
|
|
|
2020-02-21 23:47:37 +00:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
2020-02-21 23:45:20 +00:00
|
|
|
(sphinx :variables
|
2020-02-22 10:35:59 +00:00
|
|
|
rst-sphinx-target-parent "~/MyProjects/")
|
2018-09-19 03:54:47 +00:00
|
|
|
#+END_SRC
|
2017-02-02 19:55:18 +00:00
|
|
|
|
2020-02-22 10:35:59 +00:00
|
|
|
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.
|
2017-02-02 19:55:18 +00:00
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
2020-02-21 23:45:20 +00:00
|
|
|
(sphinx :variables
|
2020-02-22 10:35:59 +00:00
|
|
|
rst-sphinx-target-parent "~/MyProjects/"
|
2020-02-21 23:45:20 +00:00
|
|
|
rst-sphinx-target-projects
|
2020-02-22 10:35:59 +00:00
|
|
|
'(("project1" . (latex "project1/_build"))
|
|
|
|
("project2" . (html "project2/_build"))))
|
2018-09-19 03:54:47 +00:00
|
|
|
#+END_SRC
|
2017-02-02 19:55:18 +00:00
|
|
|
|
|
|
|
** 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.
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
2020-02-21 23:45:20 +00:00
|
|
|
(sphinx :variables
|
|
|
|
rst-slides-program "chromium")
|
2018-09-19 03:54:47 +00:00
|
|
|
#+END_SRC
|
2017-02-02 19:55:18 +00:00
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
2020-02-21 23:45:20 +00:00
|
|
|
| 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 |
|