def plugin_loaded(): add_whitelist_module('latextools_utils') viewers_path = os.path.join(sublime.packages_path(), 'LaTeXTools', 'viewers') # ensure that base_viewer is loaded first so that other viewers are registered # as plugins add_plugin_path(os.path.join(viewers_path, 'base_viewer.py')) add_plugin_path(viewers_path)
def plugin_loaded(): latextools_plugin.add_whitelist_module('latex_chars') # load plugins from the bibliography_plugins dir of LaTeXTools if it exists # this allows us to have pre-packaged plugins that won't require any user # setup os_path = os.path latextools_plugin.add_plugin_path( os_path.join(os_path.dirname(__file__), 'bibliography_plugins'))
# Usually no need to override def set_output(self, out): if DEBUG: print("Setting out") print(out) self.out = out # This is where the real work is done. This generator must yield (cmd, msg) tuples, # as a function of the parameters and the output from previous commands (via send()). # "cmd" is the command to be run, as an array # "msg" is the message to be displayed (or None) # As of now, this function *must* yield at least *one* tuple. # If no command must be run, just yield ("","") # Remember that we are now in the root file's directory def commands(self): raise NotImplementedError() # Clean up after ourselves # Only the build system knows what to delete for sure, so give this option # Return True if we actually handle this, False if not # # NOTE: problem. Either we make the builder class persistent, or we have to # pass the tex root again. Need to think about this def cleantemps(self): return NotImplementedError() # ensure pdfBuilder is available to any custom builders latextools_plugin.add_whitelist_module('pdfBuilder', sys.modules[PdfBuilder.__module__])
command to open a file :params: pdf_file - full path to the generated pdf ''' raise NotImplementedError() def supports_keep_focus(self): ''' return True to indicate that this plugin supports the keep_focus setting or False (the default) to use the default refocus implementation ''' return False def supports_platform(self, platform): ''' return True to indicate that this plugin supports the reported platform or False to indicate that it is not supported in the current platform / environment ''' return True def focus_st(self): st_utils.focus_st() latextools_plugin.add_whitelist_module( 'base_viewer', sys.modules[BaseViewer.__module__] )
# Usually no need to override def set_output(self, out): if DEBUG: print("Setting out") print(out) self.out = out # This is where the real work is done. This generator must yield (cmd, msg) tuples, # as a function of the parameters and the output from previous commands (via send()). # "cmd" is the command to be run, as an array # "msg" is the message to be displayed (or None) # As of now, this function *must* yield at least *one* tuple. # If no command must be run, just yield ("","") # Remember that we are now in the root file's directory def commands(self): raise NotImplementedError() # Clean up after ourselves # Only the build system knows what to delete for sure, so give this option # Return True if we actually handle this, False if not # # NOTE: problem. Either we make the builder class persistent, or we have to # pass the tex root again. Need to think about this def cleantemps(self): return NotImplementedError() # ensure pdfBuilder is available to any custom builders latextools_plugin.add_whitelist_module('pdfBuilder', sys.modules[PdfBuilder.__module__] )
raise NotImplementedError() def view_file(self, pdf_file, **kwargs): ''' command to open a file :params: pdf_file - full path to the generated pdf ''' raise NotImplementedError() def supports_keep_focus(self): ''' return True to indicate that this plugin supports the keep_focus setting or False (the default) to use the default refocus implementation ''' return False def supports_platform(self, platform): ''' return True to indicate that this plugin supports the reported platform or False to indicate that it is not supported in the current platform / environment ''' return True latextools_plugin.add_whitelist_module('base_viewer', sys.modules[BaseViewer.__module__] )