03-08-2013, 10:18 AM | #16 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
|
03-08-2013, 10:18 AM | #17 | |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Glad it's working for you. As per Kovid's new plugin CLI feature, I'll be adding CLI via calibre to my plugins in future.
Quote:
|
|
03-08-2013, 10:20 AM | #18 |
Well trained by Cats
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Whose pages? EPUB does not have 'pages'.
Kiwidude made the Count Pages PI with the ability to chose from a number of differing count algorithms. |
03-08-2013, 10:36 AM | #19 |
creator of calibre
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
03-08-2013, 06:23 PM | #20 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Kovid,
I've been playing with this and with a bit of work I'm able to get my existing CLI interfaces to run using 'calibre-debug --run-plugin'. That's pretty cool. However, while figuring out how to get at the config preferences my PI has stored in db.prefs.get/set_namespaced, I realized that calibre-debug doesn't have the '--with-library' option that calibredb does. I can relatively easily get the db for the library last used in the gui, but not a specified one. If CLI plugins are meant to be able to access/update library db's, might it be better to make run_plugin a command under calibredb and pass the db in to cli_main? I finally made myself a working src dir for calibre, so I can do the coding for this approach and submit it for your review, if you like. |
03-08-2013, 10:10 PM | #21 |
creator of calibre
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If your plugin needs access to the db, you can add a --with-library option to your plugin. Then do
calibre-debug -r "plugin name" -- --with-library /whatever |
03-14-2013, 01:29 PM | #22 | |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
Split on basis of number of words?
Quote:
Is there any option to split the epub on the basis of words or page numbers? |
|
03-14-2013, 01:42 PM | #23 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
|
03-14-2013, 01:45 PM | #24 |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
Thanks for the clarification.
Is there any way to do this on the basis of pages? Can we cut out pages within a chapter? Is that possible at all? |
03-14-2013, 01:49 PM | #25 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I'm not aware of any existing way. Frankly, I can't imagine why you'd want to.
|
03-14-2013, 03:02 PM | #26 |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
This is for creating previews or excerpts out of these books.
|
03-14-2013, 03:10 PM | #27 |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
Can you think of any vague idea of how this may be proceeded with? Like splitting on the basis of number of words or pages?
|
03-14-2013, 03:33 PM | #28 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I can think of ways that might do it, sure.
You could look inside the Count Pages plugin for ideas on how to count pages and words to find where you want to split. After that, you could look at the splitHtml() function in my epubsplit.py for ideas on how to extract only desired ranges of HTML. Or you could maybe use epubsplit as-is by Inserting an anchor tag at the point you want to split (found by counting words/pages) and add it to the TOC. Then use epubsplit. |
03-14-2013, 04:47 PM | #29 |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
Thank you for the ideas. Very helpful.
|
03-19-2013, 04:05 PM | #30 | |
Member
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
|
Step by step instruction please
Quote:
1. Get the word count and get the page, at the html page which need to be split add a anchor tag with some text like <html> .... <body> <p>lorunm dfdsfds hjfldsf</p> <a>cuthere</a> <p>lorunm dfdsfds hjfldsf</p> </body> </html> Now i ran this through the epubsplit options generator and it did nothing without adding anything to TOC. Then add this do TOC? You mean the Table of contents page? Add a new entry? How can i do that. Step by step will help greatly. Thanks. |
|
Tags |
.net, automate, calibre, commandline, epubsplit |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] EpubSplit | JimmXinu | Plugins | 411 | 02-11-2024 05:35 PM |
Automate Calibre Tagging | ohemeffgee | Library Management | 1 | 11-11-2012 06:56 AM |
Any way to automate editting metadata? | louwin | Library Management | 4 | 04-24-2012 06:58 PM |
Help Merging Multiple Small Epubs into One Large Epub | kazbates | Workshop | 14 | 09-15-2011 02:18 AM |
I am looking for a tool that could automate convertion of... | astra | Workshop | 24 | 08-30-2009 06:38 AM |