#NEWLINE# def rst_to_html( rst_text ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# from docutils.core import publish_string #NEWLINE# bootstrap_css_path = os . path . join ( sublime . packages_path ( ) , 'RstPreview/css/bootstrap.min.css' ) #NEWLINE# base_css_path = os . path . join ( sublime . packages_path ( ) , 'RstPreview/css/base.css' ) #NEWLINE# args = { #NEWLINE# #INDENT# 'stylesheet_path' : ',' . join ( [ bootstrap_css_path , base_css_path ] ) , #NEWLINE# 'syntax_highlight' : 'short' , #NEWLINE# #UNINDENT# } #NEWLINE# return publish_string ( bootstrap_css_path , writer_name = 'html' , settings_overrides = args ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# error_msg = 'RstPreview requires docutils to be installed for the python interpreter that Sublime uses.\n    run: `sudo easy_install-2.6 docutils` and restart Sublime (if on Mac OS X or Linux). For Windows check the docs at\n    https://github.com/d0ugal/RstPreview' #NEWLINE# sublime . error_message ( error_msg ) #NEWLINE# raise