MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Recipes (https://www.mobileread.com/forums/forumdisplay.php?f=228)
-   -   Recipe to output ToC as flattened ? (https://www.mobileread.com/forums/showthread.php?t=314672)

iddetik 01-26-2019 01:11 AM

Recipe to output ToC as flattened ?
 
I'm not sure how to say it properly, I have a recipe with hundreds of feeds. However these feeds only contains 2-8 articles and all these feeds are connected to each other.

The default way Calibre fetching these feeds will result in messy ToC in epub to be like this :

Title
|
|- Feeds1
| |
| |-Article 1
| |-Article 2
|
|-Feeds2
| |
| |-Article 3
| |-Article 4
...
|
|-Feeds487
| |
| |-Article 874
| |-Article 875
| |-Article 876

Is there any way for me to simplify the output so i don't have html named Feeds and just make a bulk of articles merged as one.

Like this i think :

Title
|-Article 1
|-Article 2
|-Article 3
...
|-Article 876

kovidgoyal 01-26-2019 01:32 AM

override parse_feeds() in your recipe. Call the base clas simplementation which will build th enormal list of articles, then manipulate the result as you like.

iddetik 01-26-2019 04:18 AM

Quote:

Originally Posted by kovidgoyal (Post 3803064)
override parse_feeds() in your recipe. Call the base clas simplementation which will build th enormal list of articles, then manipulate the result as you like.

Thank you for the guide, i'll see what i can do

iddetik 01-26-2019 04:37 AM

Sorry to bother you again, may i know any tools that can debug ebook-converter when running so i can see how the populated feed object looks like?

Right now i'm looking at https://manual.calibre-ebook.com/de/...pe.parse_feeds but i still struggling with how the hierarcy implemented.

kovidgoyal 01-26-2019 05:25 AM

You can use simple print statements and their output will be visible when you run ebook-convert

iddetik 01-26-2019 06:27 AM

Quote:

Originally Posted by kovidgoyal (Post 3803086)
You can use simple print statements and their output will be visible when you run ebook-convert

Simple print statements did the job! Albeit a little bit slow for me i finally could make it works as 1 big feed, then trim the feed page from ToC.

Thank you!


All times are GMT -4. The time now is 10:03 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.