There you go:
Contents of the .sublime-build
:
{
"target": "rebuild_wiki",
"variants": [
{ "name": "Run", "refresh": true },
{ "name": "ikiwikiEditing: Refresh", "refresh": true },
{ "name": "ikiwikiEditing: Refresh and Verbose", "verbose": true ,"refresh": true },
{ "name": "ikiwikiEditing: Rebuild", "refresh": false },
{ "name": "ikiwikiEditing: Rebuild and Verbose", "verbose": true ,"refresh": false },
{ "name": "ikiwikiEditing: Update Tags", "utags": true },
]
}
Contents of rebuildwiki.py
:
import sublime, sublime_plugin
class RebuildWikiCommand(sublime_plugin.WindowCommand):
def run(self, verbose=False, refresh=False, utags=False):
s = sublime.load_settings("ikiwikiMarkdown.sublime-settings")
setup_file = s.get("ikiwiki_setup_file")
working_dir = s.get("ikiwiki_working_dir")
def build_ikicmd():
ikicmd = "ikiwiki"
if setup_file:
ikicmd+=(" --setup " + setup_file)
else:
sublime.status_message("Please add setup file in ikiwikiEditing options!")
if verbose:
ikicmd+=(" --verbose")
if refresh:
ikicmd+=(" --refresh")
if utags:
tag_file = s.get("ikiwiki_tag_file")
completion_file = s.get("ikiwiki_completion_file")
ikicmd+=(" --render " + tag_file + " > " + completion_file)
return ikicmd
self.window.run_command('exec', {'shell_cmd': build_ikicmd(), 'working_dir': working_dir} )