Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-25-2018, 04:35 PM   #301
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 843
Karma: 3335974
Join Date: Jan 2017
Location: Poland
Device: Various
Quote:
Originally Posted by KevinH View Post
Based on the discussion here and in the FolderIn/FolderOut thread, I have just committed to master support for two new plugin features available in edit, output, and validation plugins:
I noticed that you mention validation plugins, but both features have not been added to the validationcontainer.py file.

bk.get_epub_is_modified()
bk.get_epub_filepath()
BeckyEbook is offline   Reply With Quote
Old 01-25-2018, 05:05 PM   #302
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: 28,597
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
I noticed that you mention validation plugins, but both features have not been added to the validationcontainer.py file.

bk.get_epub_is_modified()
bk.get_epub_filepath()
If I remember correctly, the ValidationContainer plugin class inherits from BookContainer. Meaning they'll be available even if you don't "see" them.

EDIT: Actually after looking, I see that ValidationContainer inherits from OutputContainer, which amounts to the same thing: both new methods being available to validation plugins.

From validationcontainer.py:
Code:
from outputcontainer import OutputContainer

class ValidationContainer(OutputContainer):

Last edited by DiapDealer; 01-25-2018 at 05:12 PM.
DiapDealer is offline   Reply With Quote
Old 01-25-2018, 05:13 PM   #303
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 843
Karma: 3335974
Join Date: Jan 2017
Location: Poland
Device: Various
Quote:
Originally Posted by DiapDealer View Post
EDIT: Actually after looking, I see that ValidationContainer inherits from OutputContainer, which amounts to the same thing: both new methods being available to validation plugins.
You're right. It was outputcontainer.py file, I forgot to update it before build. Everything works now.
BeckyEbook is offline   Reply With Quote
Old 01-25-2018, 08:49 PM   #304
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Hi everyone...I'm in a dilemma. I'm currently finishing off testing a new plugin called MendeleyRefsImport and its going reasonably well. This plugin takes a file exported from Mendeley as EndNotes v8 xml and formats all the selected ref/notes in Chicago Stye(user choice) and then appends them to to your selected chapter or blank reference file in the epub.

It suddenly struck me today that this plugin might also work for an xml file exported from Endnotes v8. I can't test whether this plugin will work on the EndNotes app because I don't have this app on my computer.

So my problems are:
How do I test this plugin on an xml export file from EndNote v8?
How do I name a plugin if it works for both Mendeley and EndNote export files?

If this plugin also worked for EndNote exported xml files, my own preference would be to create two separate plugins -- one called MendeleyRefsImport and the other one called EndNoteRefsImport -- in order to explicitly show that there are two plugins for each of these apps in the Sigil Plugin Index. But the code in these two plugins would be exactly the same. I'm also not sure whether this would be allowed. All suggestions would be greatly appreciated.

If anyone would like to try out my new plugin using an xml export file from either Mendeley or EndNote v8 you can download it -- see below. There's also a README file in the zip file that describes in detail how to use this plugin with Mendeley.

Update: I've decided to download EndNote v8 for a 30 day trial. That should give me ample time to test this plugin with xml export files from EndNote. I'm also hoping that export as xml will be available in the trial version.
Attached Files
File Type: zip MendeleyRefsImport_v010.zip (50.0 KB, 422 views)

Last edited by slowsmile; 01-25-2018 at 10:29 PM.
slowsmile is offline   Reply With Quote
Old 01-26-2018, 12:57 PM   #305
Maui
Connoisseur
Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.
 
Maui's Avatar
 
Posts: 57
Karma: 600000
Join Date: Jan 2018
Device: Galaxy Tab S2
Quote:
Originally Posted by DiapDealer View Post
Also... a non-copyright-violating epub sample that can be used to reproduce the error would be nice. If Sigil can make use of the file in the epub without problems, then the plugin framework's bk.readfile() really shouldn't barf on it either. Perhaps there's something unforeseen we need to account for.
Well,

there is no issue in Sigil. The font files have been deleted outside from Sigil improperly and i only stumbled upon this improper modification as my plugin throwed an error message. I only wanted to know how i can catch those errors.

The manifest was already corrected immediatly after i noticed what the root cause was.

M
Maui is offline   Reply With Quote
Old 01-26-2018, 01:22 PM   #306
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: 28,597
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Maui View Post
Well,

there is no issue in Sigil. The font files have been deleted outside from Sigil improperly and i only stumbled upon this improper modification as my plugin throwed an error message. I only wanted to know how i can catch those errors.

The manifest was already corrected immediatly after i noticed what the root cause was.

M
OK, thanks. I just wanted to make sure it wasn't something the plugin framework should be taught to deal with or not. I mean, if the epub is open and editable in Sigil in general ... then invoking bk.readfile() in a plugin shouldn't error out on any html/css files in my opinion.
DiapDealer is offline   Reply With Quote
Old 02-02-2018, 11:49 AM   #307
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 843
Karma: 3335974
Join Date: Jan 2017
Location: Poland
Device: Various
My suggestions:
1. Allow adding 10 plugins for toolbar. 5 is good, but 10 will be better. Ask other users.
2. Change the standard icons for plugins to numbers. In this situation, even a plug-in without an icon will be easier to identify.

---
Alternative icon for ePub3-tizer. Original icon is a bit unreadable.
Attached Thumbnails
Click image for larger version

Name:	becky-icons.png
Views:	622
Size:	29.5 KB
ID:	162038  
Attached Images
 
Attached Files
File Type: zip digits.zip (15.0 KB, 463 views)
BeckyEbook is offline   Reply With Quote
Old 02-02-2018, 12:04 PM   #308
KevinH
Sigil Developer
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: 8,800
Karma: 6000000
Join Date: Nov 2009
Device: many
10 seems a bit much to me. If we go that high we will have to create arrays of action pointers otherwise the code will get too repetitive and unwieldy. The purpose for the 5 icons was just for most frequently used plugins. The plugin dynamically generated menus can be assigned key accelerators for all plugins, which can make launching the plugins as easy or even easier than using the quicklaunch icons on the toolbar.

Thanks for your updated ePub3-itizer plugin icon. On my machine you can read my original clearly. Not sure why it is unclear on yours. Perhaps you are setting the toolbar icon sizes much smaller than I am. See the Sigil preference setting for that.

Also not sure I personally like just numbers for default icons as it is not clear they are plugin related at all. I prefer sticking with the electrical plugs and pips which seems safer to me.

Last edited by KevinH; 02-02-2018 at 12:10 PM.
KevinH is offline   Reply With Quote
Old 02-02-2018, 12:19 PM   #309
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 843
Karma: 3335974
Join Date: Jan 2017
Location: Poland
Device: Various
Sure. Thanks for the clarification.

I have over 50 plugins and hundreds of key combinations in my head from various programs, so the colored icons are more convenient for me.
BeckyEbook is offline   Reply With Quote
Old 02-02-2018, 12:26 PM   #310
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: 28,597
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I agree that 5 on the toolbar is enough. Not every plugin you have installed needs to be at your very fingertips.

Number icon on the toolbar won't tell new users anything. I prefer to stick with the existing plugin icons. I'm not down with messing with established icons in general. There's never a consensus on what icons would be "best," anyway.
DiapDealer is offline   Reply With Quote
Old 02-02-2018, 12:45 PM   #311
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
@BeckyEbook: I like the icons that you've created for the EpubCheck, Epub2LegacyMetaData and KindleGen plugins and would like to use them for future versions.
Can you please attach them?
Doitsu is offline   Reply With Quote
Old 02-02-2018, 01:05 PM   #312
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 843
Karma: 3335974
Join Date: Jan 2017
Location: Poland
Device: Various
Of course.
Attached Images
   
BeckyEbook is offline   Reply With Quote
Old 02-02-2018, 11:00 PM   #313
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Hi All...I was just wondering if any of the Sigil plugin container classes had a function or method that would allow me to insert text at the cursor in Sigil's Book View within a particular html file in Sigil.

The reason I'm asking is that I was thinking that it might be quite useful to have a plugin that could insert short citations into the text in Text View in Sigil with a view, in the same plugin, to eventually create links automatically from each of these citation entries either to the endnote chapter sections containing the relevant reference or to a reference item in the bibliography section. Just wondering if this is possible.

Last edited by slowsmile; 02-02-2018 at 11:17 PM.
slowsmile is offline   Reply With Quote
Old 02-02-2018, 11:49 PM   #314
KevinH
Sigil Developer
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: 8,800
Karma: 6000000
Join Date: Nov 2009
Device: many
I am not sure what you are asking exactly, but plugins and the plugin interfaces actually only work at the file level of an expanded epub inside Sigil (and uses copy on modify semantics too) and do not interact in any way with other elements of Sigil directly. It was designed that way to protect Sigil. As the plugin makes changes to xhtml, image, etc using the interface the opf is rebuilt automatically and the copied and modified results are stored away in a temporary directory. Upon completion of the plugin, an xml file which lists the changed, deleted, and added files is passed back from the forked plugin process and is used by Sigil itself to update the files that were changed, add the new files, and delete the removed files. The plugin interface does offer the list of files that are highlighted in the Bookbrowser when the plugin in launched if you only want to process a limited set of files.

A plugin also has access to bs4, gumbo, hunspell spellcheckers, and a number of required python libraries like cssutils, lxml, PIL and things and can use its own gui either pyqt or tk to interact with the user, but it is always working on the epub's file (copies of them) in a forked process that Sigil itself is waiting to finish and reading stdout from for the xml that tells Sigil what to do.

If you need to pass a specfic location in the code to the plugin, you must explain how the user should mark that text in some way using tags or text keys, before launching the plugin and then have the plugin limit itself to the currently highlighted file in Bookbrowser and search for your marker in that file and process it as you want.
KevinH is offline   Reply With Quote
Old 02-03-2018, 01:09 AM   #315
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@KevinH...I think you covered everything that I asked. Thanks for explaining it so thoroughly. I think we can say that my question is just not possible.

Regarding marking lines of text that you mentioned, I have already written a private plugin that only adds spans(with no styling) around only centered text and images in an epub. I just wanted to surround centered items with no-style spans to accommodate ebooks that I upload to iBook -- which still needs no-style spans for anything that's centered. The only way I could do this was to use a marker(like you suggested). I used a tilde symbol('~' ) to manually mark all centered items in my epub and that worked just fine. I haven't release that plugin because I thought it was redundant -- usually, for iBooks uploads, people mostly surround everything in their epubs with no-style spans which seems to work just as well. Thanks again for the explanation.
slowsmile is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:49 PM.


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