Skip to content

Commit

Permalink
Merge pull request #2 from PacificMorrowind/master
Browse files Browse the repository at this point in the history
Windows Support
  • Loading branch information
yyjhao committed Jun 8, 2014
2 parents ff95dde + dab8244 commit 9c31ba0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions markmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self):

def update(self, settings):
self.settings = {
"executable": settings.get("executable", 'markmon'),
"port": settings.get("port", 3000),
"command": settings.get("command", "pandoc -t HTML5"),
"stylesheet": settings.get("stylesheet", None),
Expand All @@ -74,7 +75,7 @@ def update(self, settings):

def build_strings(self):
self.client_url = "localhost:{:d}".format(self.settings['port'])
self.server_command = ['markmon',
self.server_command = [self.settings["executable"],
"--port", str(self.settings['port']),
"--command", self.settings['command']]
if self.settings['stylesheet']:
Expand Down Expand Up @@ -125,7 +126,12 @@ def setup_server(self, _=None):
env = os.environ.copy()
betterenv = util.create_environment()
env["PATH"] = betterenv["PATH"]
subprocess.Popen(self.settings.server_command, env=env)
try:
subprocess.Popen(self.settings.server_command, env=env)
except FileNotFoundError as e:
print("Markmon Server failed to initialize. Confirm executable path is correct in Markmon Setting. Command used:")
print(self.settings.server_command)
raise

def cleanup_server(self):
if self.server_url:
Expand Down
3 changes: 3 additions & 0 deletions sublime-text-markmon.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
//On Windows try "markmon.cmd" if you get errors.
//If markmon is not on your path you'll need to use a full path to it
"executable": "markmon",
"port": 3002,
"command": "pandoc -t HTML5 --mathjax",
"stylesheet": null,
Expand Down

0 comments on commit 9c31ba0

Please sign in to comment.