2017-02-02 14:29:45 +00:00
|
|
|
#+TITLE: reStructuredText layer
|
2016-07-23 16:07:07 +00:00
|
|
|
|
2017-04-25 15:42:58 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
2017-08-28 21:58:10 +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]]
|
2016-07-23 16:07:07 +00:00
|
|
|
|
|
|
|
* Description
|
2017-02-02 14:29:45 +00:00
|
|
|
The layer adds ReStructuredText (ReST) support to Spacemacs and adds some
|
|
|
|
functions to =rst-mode=.
|
2016-07-23 16:07:07 +00:00
|
|
|
|
2017-08-28 21:58:10 +00:00
|
|
|
** Features:
|
2017-02-02 14:29:45 +00:00
|
|
|
- =rst= files are supported via Emacs built-in =rst.el=.
|
2016-11-21 23:32:00 +00:00
|
|
|
- Lists are inserted by new functions.
|
2017-02-02 14:29:45 +00:00
|
|
|
- Directives can be inserted easily.
|
|
|
|
- Sphinx support.
|
2016-07-23 16:07:07 +00:00
|
|
|
|
|
|
|
* Install
|
2017-02-02 14:29:45 +00:00
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
add =restructuredtext= to the existing =dotspacemacs-configuration-layers= list
|
|
|
|
in this file.
|
2016-07-23 16:07:07 +00:00
|
|
|
|
|
|
|
* Configuration
|
2017-02-02 14:29:45 +00:00
|
|
|
** Sphinx target
|
2016-07-23 16:07:07 +00:00
|
|
|
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
|
|
|
|
|
2017-02-02 14:29:45 +00:00
|
|
|
** Web browser
|
|
|
|
Set the browser for viewing the HTML page of current rst file. This one
|
2016-07-23 16:07:07 +00:00
|
|
|
is optional. If not set, the default browser will be used.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq rst-slides-program "chromium")
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
|
|
|
| Key Binding | Description |
|
|
|
|
|-------------+-----------------------------------------|
|
|
|
|
| ~<SPC> m c~ | compile projects |
|
|
|
|
| ~<SPC> m f~ | open compiled HTML page of current page |
|