mgaitan / sublime-rst-completion

Restructured Text snippets and code completion hotkeys for Sublime Text 2 and 3
BSD 3-Clause "New" or "Revised" License
251 stars 52 forks source link

[mac os x 10.9.5] rst2html failed #77

Closed keepeye closed 9 years ago

keepeye commented 9 years ago

i pressed ctrl+shift+r and choosed rst2html,but it outputted nothing and no error reported. then i modified your codes like below:

def open_result(self, outfile, target):
        if target == "html":
            os.system("open %s" % outfile)
            # webbrowser.open_new_tab(outfile)

now,it works temporarily.

mgaitan commented 9 years ago

thanks xian, I'll check what's happening with this.

In a sake of completeness, what OS and Sublime version are you using?

On Tue, Dec 9, 2014 at 6:52 AM, Xian Zhao notifications@github.com wrote:

it outputted nothing,no error reported,so i modified your codes like below:

def open_result(self, outfile, target): if target == "html": os.system("open %s" % outfile)

webbrowser.open_new_tab(outfile)

now,it work temporarily.

— Reply to this email directly or view it on GitHub https://github.com/mgaitan/sublime-rst-completion/issues/77.

mgaitan.github.io textosypretextos.com.ar http://textosyprextextos.com.ar

mgaitan commented 9 years ago

what a silly, I've just seen the subject! :D

On Tue, Dec 9, 2014 at 9:47 AM, Martín Gaitán gaitan@gmail.com wrote:

thanks xian, I'll check what's happening with this.

In a sake of completeness, what OS and Sublime version are you using?

On Tue, Dec 9, 2014 at 6:52 AM, Xian Zhao notifications@github.com wrote:

it outputted nothing,no error reported,so i modified your codes like below:

def open_result(self, outfile, target): if target == "html": os.system("open %s" % outfile)

webbrowser.open_new_tab(outfile)

now,it work temporarily.

— Reply to this email directly or view it on GitHub https://github.com/mgaitan/sublime-rst-completion/issues/77.

mgaitan.github.io textosypretextos.com.ar http://textosyprextextos.com.ar

mgaitan.github.io textosypretextos.com.ar http://textosyprextextos.com.ar

keepeye commented 9 years ago

ha! I know how it is caused.Because my default webbrowser is Chrome. outfile must contain a scheme file:// when open a local file just like:

outfile = "file:///var/folders/86/2zqykwwd1f71bdb0d1tg20p80000gn/T/tmp28_694.html"
webbrowser.open_new_tab(outfile)

codes below do not work:

outfile = "/var/folders/86/2zqykwwd1f71bdb0d1tg20p80000gn/T/tmp28_694.html"
webbrowser.open_new_tab(outfile)

My Sublime version is 'sublime text 3 build 3065' and OS version is 'OSX 10.9.5'.

mgaitan commented 9 years ago

On Tue, Dec 9, 2014 at 11:04 PM, Xian Zhao notifications@github.com wrote:

outfile = "file:///var/folders/86/2zqykwwd1f71bdb0d1tg20p80000gn/T/tmp28_694.html" webbrowser.open_new_tab(outfile)

what if we prepend "file://" no matter the browser? should it work?

keepeye commented 9 years ago

On Tue, Dec 9, 2014 at 11:04 PM, Xian Zhao notifications@github.com wrote: outfile = "file:///var/folders/86/2zqykwwd1f71bdb0d1tg20p80000gn/T/tmp28_694.html" webbrowser.open_new_tab(outfile) what if we prepend "file://" no matter the browser? should it work?

At least Safiri and Chrome work well and i guess the others will be the same.

mgaitan commented 9 years ago

thanks for the help @keepeye