Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-17-2019, 08:42 AM   #451
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 21,297
Karma: 116741460
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Vroni View Post
or is something availöable in the API to make use of?
We've been mentioning the new stuff available in the api all along.

There's the group functions which return the locations of the different mimetypes (where are the xhtml files being kept, where are the css files stored, where is the opf?). Then there's still the href from the iter functions that can be used in combination with the group data (or the relative link between two hrefs just discussed) and other things.

It's not a matter of not being able to "trust" that certain locations will be present. It's a matter of switching to new methods/paradigms that don't make hard-coded assumptions about where things always used to be.

Examples of all this are in the plugins that have already been updated to accommodate non-standard (as well as standard) epub structures.

If you have any specific code-related questions as to how to perform a certain task, feel fee to ask--in words OR in Python.

Last edited by DiapDealer; 11-17-2019 at 08:45 AM.
DiapDealer is offline   Reply With Quote
Old 11-17-2019, 10:28 AM   #452
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,877
Karma: 2514398
Join Date: Nov 2009
Device: many
Yes bk.addfile() still works as before. It will check the filename to make sure it is unique and the add the file to the current default folder for that file group. The id is returned and you can always do a bk.id_to_bookpath() routine to get the resulting bookpath.

Or you can get the folders to be used via file group and choose among them if there is more than one, etc.

Or you can create your own bookpath and pass that to the new way to add a file.
KevinH is online now   Reply With Quote
Old 11-17-2019, 10:32 AM   #453
Vroni
Beast
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 154
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
Creating a new xhtml file. Currently i "just" need to place an entry in the spine (getspine; setspine) and then just call addfile. Theres no other place it can go right now as in the TEXT folder. In the new version, it can go anywhere and i have to query the user where it should be stored...

Vroni
Vroni is offline   Reply With Quote
Old 11-17-2019, 11:19 AM   #454
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 3,877
Karma: 2514398
Join Date: Nov 2009
Device: many
Or just do as before and use the default folder for that group (type of file). Actually, I think adding an xhtml file in the plugin should auto handle the spine for you (but it has been a long time since I checked that code).
KevinH is online now   Reply With Quote
Old 11-17-2019, 11:29 AM   #455
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 21,297
Karma: 116741460
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Or just do as before and use the default folder for that group (type of file).
Agreed.

You're free to query the user for as little, or as much info as you like. They didn't have a choice in where your newly-created xhtml file went before, and they don't really need a choice now (unless you want to give them one). The physical location of the xhtml file in the archive has no functional relevance to how the epub will render. That is taken care of by the spine section in the opf. If after your plugin is done, the user doesn't like where the file is physically located, we've given them the tools to put it wherever they want.
DiapDealer is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Plugin in development Sladd Development 6 06-17-2014 07:57 PM
Question for plugin development gurus DiapDealer Plugins 2 02-05-2012 12:33 AM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 10:46 AM
Device plugin development reader42 Plugins 10 03-29-2010 01:39 PM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 01:44 PM


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


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