Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 10-15-2020, 11:14 PM   #1
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
New element of list returned by parse_index()

Hello,

About the list returned by parse_index():
1. Besides title, url, date, description and content, do we have chance to add extra new elements for the list?
2. Can we customize the style of each element?

Thanks, Fei.
njpig is offline   Reply With Quote
Old 10-16-2020, 02:09 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No you can add anything, and no they are all plain text, except for description which can have html markup
kovidgoyal is offline   Reply With Quote
Advert
Old 10-16-2020, 02:39 AM   #3
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
I tried to insert <hr> like this:
desc += '<hr>'

However, looks like ebook-convert removed it.

Thanks, Fei.
njpig is offline   Reply With Quote
Old 10-16-2020, 02:44 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
removed it from where??
kovidgoyal is offline   Reply With Quote
Old 10-16-2020, 02:57 AM   #5
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
With code below, there is no line break between 'first line' and 'second line'.
------------------------------
....
desc = 'first line'
desc += '<br>'
desc += 'second line'
articles.append({'title': title, 'url': url, 'description': desc}
....
njpig is offline   Reply With Quote
Advert
Old 10-16-2020, 03:05 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, but no page break where? Where are you seeing this description? If it is in the kindle's special periodical toc then no, you cant use formatting there.
kovidgoyal is offline   Reply With Quote
Old 10-16-2020, 03:38 AM   #7
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
As I'm a newbie to Calibre and recipe, I might not fully understand you. So I clarified what I had done:
--------
Actually, I wanted to append author to the description so I added this code to parse_index() in foreign_policy.recipe:
desc += '<br>'
desc += author

then, run:
ebook-convert calibre/recipe/foreign_policy.recipe ./ebook.epub -d ./log --output-profile kindle_oasis -vv

then opened ebook.pub and jumped to a section menu. The line break was not output as I expected.

I checked log/processed/feed_0/index.html. The line break was not output as well.
njpig is offline   Reply With Quote
Old 10-16-2020, 03:52 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Remove the output_profile and see if that helps. And dont create epubs if ou intend to use them on the kindle, create mobi directly.
kovidgoyal is offline   Reply With Quote
Old 10-16-2020, 04:04 AM   #9
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
I removed output_profile option, but did not work.
njpig is offline   Reply With Quote
Old 10-16-2020, 08:37 PM   #10
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
Quote:
Originally Posted by kovidgoyal View Post
And dont create epubs if ou intend to use them on the kindle, create mobi directly.
Yes. I should have created mobi directly. Thanks a lot!

One more question:
Do we have chance to generate both epub and mobi by running ebook-convert just once?
I did not find a way how to do it from the manual of ebook-convert.
njpig is offline   Reply With Quote
Old 10-16-2020, 08:45 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by njpig View Post
Yes. I should have created mobi directly. Thanks a lot!

One more question:
Do we have chance to generate both epub and mobi by running ebook-convert just once?
I did not find a way how to do it from the manual of ebook-convert.
NO
Different pipelines.
theducks is offline   Reply With Quote
Old 10-17-2020, 12:52 AM   #12
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
Quote:
Originally Posted by theducks View Post
NO
Different pipelines.
After creating mobi directly and pushing it to kindle/kindle app via email:
1. the top/bottom nav bar disappeared
2. could not jump to cover page

Do I have chance to resolve these?
njpig is offline   Reply With Quote
Old 10-17-2020, 02:41 AM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, amazon prevents you from sending preiodicals by email, reformatting them as plain books, you have to use usb
kovidgoyal is offline   Reply With Quote
Old 10-19-2020, 11:21 PM   #14
njpig
Zealot
njpig began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
Quote:
Originally Posted by kovidgoyal View Post
No, amazon prevents you from sending preiodicals by email, reformatting them as plain books, you have to use usb
Is it possible to generate common mobi ebook rather than periodicals via convert-book?

I did not find any option with calibre ebook-convert manual.
njpig is offline   Reply With Quote
Old 10-19-2020, 11:40 PM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, and why would you want to do that? If you do, just do a MOBI to MOBI conversion after generating your initial periodical MOBI.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help in parse_index with irregular css skyland_rw Recipes 0 01-07-2014 10:07 AM
parse_index() question mr.w0lf Recipes 2 10-11-2013 05:30 AM
No declaration found for element 'list-holder' kakkalla Sigil 4 05-18-2013 05:24 AM
Use parse_index to parse XML? surf Recipes 0 02-10-2013 04:36 AM
Article Dates with parse_index EnergyLens Calibre 6 04-21-2010 10:13 PM


All times are GMT -4. The time now is 04:13 PM.


MobileRead.com is a privately owned, operated and funded community.