![]() |
#31 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 2666666
Join Date: Nov 2020
Device: none
|
I'm now trying to figure out how sections are created, I guess each block level HTML tag is a section?
I think the kindle previewer cli must be able to "see" the book HTML since it could ignore hidden tags and find the css rules of a tag. The style rules are tricky to implement, maybe using a headless browser? Here is the code: https://github.com/xxyzz/kpfgen, it could only add the cover section for now. |
![]() |
![]() |
![]() |
#32 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,656
Karma: 85000001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#33 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,656
Karma: 85000001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
I started looking at your kpfgen repository and realized when I answered this question originally that I forgot about some key/value pairs that are removed during conversion from KPF to KFX. Those keys with local symbols starting with yj.authoring, yj.conversion, yj.print, or yj.semantics are not needed.
|
![]() |
![]() |
![]() |
#34 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 2666666
Join Date: Nov 2020
Device: none
|
I have figured out how to use selenium to check if an element is displayed and get all the css rules applied to it.
I guess the text of tags in the same "block" are in the same "structure", probably by checking the "display" css rule. But I don't know which html tag creates the "container" type "structure". It seems the table tag creates the "table" type, and most tags are "text" type. I could get all the css rules of an element but kindle previewer only uses a few rules on an element and it also change the rule type and value, for example, "padding-left: 1em;" is changed to Code:
margin_left: { value: 3.7039999961853027e0, unit: percent } |
![]() |
![]() |
![]() |
#35 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,656
Karma: 85000001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
Quote:
I believe using the original style will work but of course it will render differently from what Amazon produces. |
||
![]() |
![]() |
![]() |
#36 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 2666666
Join Date: Nov 2020
Device: none
|
The code kind of works now. I test this book https://standardebooks.org/ebooks/le...d/john-tenniel and some titles in context table are not clickable and images somehow can't display. And I haven't add any css rules.
Last edited by xxyzz; 04-09-2024 at 05:27 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Output] KFX Output | jhowell | Plugins | 1555 | Yesterday 08:01 AM |
[Conversion Output] KePub Output Plugin | jgoguen | Plugins | 566 | 08-07-2024 09:12 AM |
KFX to KFX to remove DRM | Tomifonication | Conversion | 12 | 08-09-2018 01:32 PM |
KFX Soon? | CRussel | Calibre | 16 | 03-06-2016 11:56 AM |
catalogue builder output columns are not in the same order in the output | KWhytte | Library Management | 5 | 12-04-2012 02:03 AM |