What code should I use to add <annotation> to fb2 file header?
I tried using this:
Code:
annotationtext = u''
annotationtext = self.oeb_book.metadata['description'][0].value
Plus some replacing, which gives me in "annotationtext" something like "<p>Blah-blah-blah</p>".
But when I try to add it to fb2 header with this:
Code:
<book-title>%(title)s</book-title>
<annotation>%(annotationtext)s</annotation>
I get an error message.
Quote:
File "/home/katya/calibre/src/calibre/ebooks/fb2/fb2ml.py", line 56, in extract_content
return self.fb2mlize_spine()
File "/home/katya/calibre/src/calibre/ebooks/fb2/fb2ml.py", line 59, in fb2mlize_spine
output = [self.fb2_header()]
File "/home/katya/calibre/src/calibre/ebooks/fb2/fb2ml.py", line 253, in fb2_header
</description>\n''') % metadata
KeyError: u'annotationtext'
|
P.S. I know it is possible, because in past I had "Update metadata" option turned on during save-to-disk and those files had annotation. But they also messed up my author edits.