2017-02-02 19:55:18 +00:00
|
|
|
#+TITLE: Sphinx layer
|
|
|
|
|
|
|
|
[[file:img/sphinx.png]]
|
|
|
|
|
|
|
|
* Table of Contents :TOC_4_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
|
|
|
|
To use the layer's Sphinx feature, the following variables should be set.
|
|
|
|
|
|
|
|
A parent directory is needed for all Sphinx projects' builds.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq rst-sphinx-target-parent "/your/path/of/build/")
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Set a directory in the parent directory for each Sphinx project.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq rst-sphinx-target-projects
|
|
|
|
'(("project1" . (latex "folder/in/target/parent" t))
|
|
|
|
("project2" . (html "folder/in/target/parent" nil))
|
|
|
|
))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** 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.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq rst-slides-program "chromium")
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
2017-02-03 16:53:28 +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 |
|