def _get_data(self, book): """Returns default data for the front and end matter templates. It mainly has default metadata from the book. :Returns: - Dictionary with default data for the templates """ show_header, show_footer = True, True if 'settings' in self.config: show_header = self.config['settings'].get('show_header', '') == 'on' show_footer = self.config['settings'].get('show_footer', '') == 'on' return { "title": get_refines(book.metadata, 'title-type', 'main'), "subtitle": get_refines(book.metadata, 'title-type', 'subtitle'), "shorttitle": get_refines(book.metadata, 'title-type', 'short'), "author": get_refines(book.metadata, 'role', 'aut'), "publisher": get_metadata(book.metadata, 'publisher'), "isbn": get_metadata(book.metadata, 'identifier'), "language": get_metadata(book.metadata, 'language'), "dir": self.direction, "metadata": book.metadata, "show_header": show_header, "show_footer": show_footer }
def _get_data(self, book): """Returns default data for the front and end matter templates. It mainly has default metadata from the book. :Returns: - Dictionary with default data for the templates """ return { "title": get_refines(book.metadata, 'title-type', 'main'), "subtitle": get_refines(book.metadata, 'title-type', 'subtitle'), "shorttitle": get_refines(book.metadata, 'title-type', 'short'), "author": get_refines(book.metadata, 'role', 'aut'), "publisher": get_metadata(book.metadata, 'publisher'), "isbn": get_metadata(book.metadata, 'identifier'), "language": get_metadata(book.metadata, 'language'), "metadata": book.metadata }