Base class for all exporters
Bases: object
Export the notebook.
Must be implemented in derived classes.
Parameters: | book – the notebook to export |
---|
Return the page numbers to be exported.
Parameters: | book – the notebook to use, instance of Book. This is necessary to be able to list all page numbers. |
---|---|
Return type: | list of integers |
EXAMPLES:
>>> from quill.exporter.base import ExporterBase
>>> exporter = ExporterBase()
>>> exporter.get_page_numbers(sample_book)
[0, 1, 2]
>>> exporter.set_page_numbers(1)
>>> exporter.get_page_numbers(sample_book)
[1]
Return whether the exporter can export multiple pages.
SVG or image export can only export a single page, while pdf or postscript allow multiple pages. This method returns whether the backend allows multiple pages. You should override this method to return True if your backend supports multiple pages.
EXAMPLES:
>>> from quill.exporter.base import ExporterBase
>>> exporter = ExporterBase()
>>> exporter.is_multipage()
False
Set the page numbers to export.
Parameters: | numbers – an integer, a list/tuple/iterable of integers, or None (default). The page numbers of the pages to export. By default, all pages are exported. |
---|
EXAMPLES:
>>> from quill.exporter.base import ExporterBase
>>> exporter = ExporterBase()
>>> exporter.get_page_numbers(sample_book)
[0, 1, 2]
>>> exporter.set_page_numbers(1)
>>> exporter.get_page_numbers(sample_book)
[1]
Bases: exceptions.Exception