- document = load_including_children(provider, slug)
-
- # check for latex packages
- if not package_available('morefloats', 'maxfloats=19', verbose=verbose):
- document.edoc.getroot().set('old-morefloats', 'yes')
- print >> sys.stderr, """
-==============================================================================
-LaTeX `morefloats' package is older than v.1.0c or not available at all.
-Some documents with many motifs in long stanzas or paragraphs may not compile.
-=============================================================================="""
+ document = load_including_children(wldoc)
+
+ if cover:
+ if cover is True:
+ cover = WLCover
+ document.edoc.getroot().set('data-cover-width', str(cover.width))
+ document.edoc.getroot().set('data-cover-height', str(cover.height))
+ if cover.uses_dc_cover:
+ if document.book_info.cover_by:
+ document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
+ if document.book_info.cover_source:
+ document.edoc.getroot().set('data-cover-source', document.book_info.cover_source)
+ if flags:
+ for flag in flags:
+ document.edoc.getroot().set('flag-' + flag, 'yes')
+
+ # check for LaTeX packages
+ if morefloats:
+ document.edoc.getroot().set('morefloats', morefloats.lower())
+ elif package_available('morefloats', 'maxfloats=19'):
+ document.edoc.getroot().set('morefloats', 'new')
+
+ # add customizations
+ if customizations is not None:
+ document.edoc.getroot().set('customizations', u','.join(customizations))