02-20-2024, 10:02 AM | #31 |
Evangelist
Posts: 428
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. |
02-20-2024, 11:39 AM | #32 | |||
Grand Sorcerer
Posts: 6,750
Karma: 86234863
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
Quote:
Quote:
|
|||
02-20-2024, 06:08 PM | #33 |
Grand Sorcerer
Posts: 6,750
Karma: 86234863
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.
|
03-01-2024, 10:37 AM | #34 |
Evangelist
Posts: 428
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 } |
03-01-2024, 03:54 PM | #35 | ||
Grand Sorcerer
Posts: 6,750
Karma: 86234863
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. |
||
04-08-2024, 11:32 AM | #36 |
Evangelist
Posts: 428
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 06:27 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Output] KFX Output | jhowell | Plugins | 1576 | Today 08:12 AM |
[Conversion Output] KePub Output Plugin | jgoguen | Plugins | 567 | 10-19-2024 06:20 PM |
KFX to KFX to remove DRM | Tomifonication | Conversion | 12 | 08-09-2018 02:32 PM |
KFX Soon? | CRussel | Calibre | 16 | 03-06-2016 12:56 PM |
catalogue builder output columns are not in the same order in the output | KWhytte | Library Management | 5 | 12-04-2012 03:03 AM |