Search code examples
pythonhtmlsublimetext2restructuredtextdocutils

Unable to run RstPreview parser in sublime text


For sublime text, I installed RstPreview, downloaded docutils-0.11, and installed it by running C:\Anaconda\python setup.py install in Command Prompt (I am using windows 7 64 bits).

When I press Ctrl+Shift+R to parse a .rst file I get the following,

enter image description here

The build system is set to C:\Anaconda\python where docutils imports normally, but seemingly sublime text tries to import docutils from the internal Python system for which I don't know how to install libraries.

Thanks in advance!


Solution

  • After reading through the issues for this plugin, it doesn't look like there is any good way of getting it to work on Windows. I can expand on the technicalities if you want, but basically this plugin relies on installing a third-party package (docutils) into the version of Python used by Sublime Text, which on Windows is completely separate from any version of Python you may have installed such as Anaconda. The author has never tested it on Windows, and from what I could find no one has posted any way to get it to run successfully on that platform.

    As an alternative, you may want to look at the OmniMarkupPreviewer plugin. From its description:

    OmniMarkupPreviewer is a plugin for both Sublime Text 2 and Sublime Text 3 that preview markups in web browsers. OmniMarkupPreviewer renders markups into htmls and send it to web browser in the backgound, which enables a live preview. Besides, OmniMarkupPreviewer provide support for exporting result to html file as well.

    It supports reStructuredText among several other formats, and while I haven't tested it personally, it looks like it would fit your needs.