用Atom在Mac OS X 下编辑reStructuredText

基础环境

  • brew cask

    brew install caskroom/cask/brew-cask
    
  • pandoc

    brew install pandoc
    

工具

设置

rst-preview-pandoc

  • 设置 pandoc path , 通过 brew install 的工具,一般都位于 /usr/local/bin
  • 采用 rst-preview-pandoc 时,可以忽略 Bugfix 1
  • 在设置 pandoc path 后,应当不会出现 Bugfix 2

Bugfix

  1. rst-preview Live preview not working Atom 1.0.11

~/.atom/packages/rst-preview/lib/rst-preview.coffee

# line 76-77
# grammars = atom.config.get('rst-preview.grammars') ? []
# return unless editor.getGrammar().scopeName in grammars
  1. Workaround on OSX for pandoc could not be spawned error

~/.atom/init.coffee

process.env.PATH = ["/usr/bin",
            "/usr/local/bin",
            ].join(":")