def run(self): from zim.export.selections import AllPages, SinglePage, SubPages notebook, page = self.build_notebook() notebook.index.check_and_update() if page and self.opts.get('recursive'): selection = SubPages(notebook, page) elif page: selection = SinglePage(notebook, page) else: selection = AllPages(notebook) exporter = self.get_exporter(page) exporter.export(selection)
def run(self): from zim.export.selections import AllPages, SinglePage, SubPages from zim.plugins import PluginManager from zim.config import ConfigManager notebook, page = self.build_notebook() # load plugins, needed so the the proper export functions would work from CLI config = ConfigManager(profile=notebook.profile) plugins = PluginManager(config) plugins.extend(notebook.index) plugins.extend(notebook) if page and self.opts.get('recursive'): selection = SubPages(notebook, page) elif page: selection = SinglePage(notebook, page) else: selection = AllPages(notebook) exporter = self.get_exporter(page) exporter.export(selection)