Hi tkeo,
Quote:
Originally Posted by tkeo
Hi Kevin,
Alongside opf, I would like to discuss about insertion of cover page and linear attribute in spine.
1. The insertion of cover page to spine is not implemented in your posted code.
I have modified to insert a cover page if it is not in spine.
It is needed to consider to offload from kindleunpack.py.
Not to implement insertion is one of choices.
Attached file rtl_example2.mobi is an example that the cover page is inserted.
|
Yes, I assumed we only insert a cover page when the RESC spine has an initial entry with no "skelid" because an existing cover page had been removed. In other words, I thought we only include a cover page if the initial epub had a cover page.
Your version always inserts a cover page if the cover_img exists but is not referenced in part 0. Your way may produce a cover page when the original had none. That said, if RESC is missing or does not parse, your version will still create a cover page when my version we will not.
I am okay with either approach, you choose.
The code is short enough we can keep it in kindleunpack.py or offload it to your mobi_cover.py by passing in the k8resc and k8proc to a routine that does the insertions there.
Quote:
2. I worry about that linear attributes might be needed to be stored in K8RESCProcessor for very special case, like attached files rtl_example1.mobi and rtl_example3.mobi.
|
So we need to modify mobi_k8resc.py to either:
A) Add spine_pagelinear={} to go with the spine_pageprops
or
B) We combine both linear and properties into one spine_pageattributes dictionary that holds all attributes of that itemref in the spine in its own dictionary.
or
C) we treat spine_pageprops as a dictionary holding a list [linear, properties]
Since you are more up to date on what can appear here, are their any other page attributes of the itemref besides "linear" and "properties" or are they the only ones that exist?
If there are others I say we go with option B as it is more general. If linear and properties are the only ones that exist we can use options A or B your choice.
Just let me know which one you prefer or simply modify mobi_k8resc.py to do what you need.
If we are in agreement on this general approach, then will you please take a shot at fixing the epub3 versions of things in the mobi_opf.py since you know that code better than I do.
Also please remove the dependency on taglist and remove mobi_taglist.py.
Then we can try merging the OPF pieces to remove redundancy while keeping it as simple as possible.
Thanks!
Kevin