from librarian.parser import WLDocument
from librarian import ParseError, DCNS, get_resource, OutputFile
from librarian import functions
+from librarian.cover import WLCover
functions.reg_substitute_entities()
'wl2tex': 'pdf/wl2tex.xslt',
}
-CUSTOMIZATIONS = [
- 'nofootnotes',
- 'nothemes',
- 'onehalfleading',
- 'doubleleading',
- 'nowlfont',
- ]
+#CUSTOMIZATIONS = [
+# 'nofootnotes',
+# 'nothemes',
+# 'defaultleading',
+# 'onehalfleading',
+# 'doubleleading',
+# 'nowlfont',
+# ]
def insert_tags(doc, split_re, tagname, exclude=None):
""" inserts <tagname> for every occurence of `split_re' in text nodes in the `doc' tree
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')
temp = mkdtemp('-wl2pdf')
if cover:
- c = cover(document.book_info.author.readable(), document.book_info.title)
+ c = cover(document.book_info)
with open(os.path.join(temp, 'cover.png'), 'w') as f:
c.save(f)