Example #1
0
def build_page_exporter(file, format, template, page, **opts):
    '''Returns an L{Exporter} that is suitable for exporting a page with
	subpages to a file and a folder (e.g. "page.html" with "page_files/")
	'''
    from zim.export.layouts import FileLayout
    from zim.export.exporters.files import MultiFileExporter

    template = get_template(format, template)
    ext = get_format(format).info['extension']
    layout = FileLayout(file, page, ext)
    return MultiFileExporter(layout, template, format, **opts)
Example #2
0
def build_notebook_exporter(dir, format, template, **opts):
    '''Returns an L{Exporter} that is suitable for exporting a whole
	notebook to a folder with one file per page
	'''
    from zim.export.layouts import MultiFileLayout
    from zim.export.exporters.files import MultiFileExporter

    template = get_template(format, template)
    ext = get_format(format).info['extension']
    layout = MultiFileLayout(dir, ext)
    return MultiFileExporter(layout, template, format, **opts)