Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-08-2015, 01:45 PM   #46
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Glad you got it working.

Thanks for picking up my support slack @jackie_w.
DiapDealer is offline   Reply With Quote
Old 07-08-2015, 02:25 PM   #47
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by DiapDealer View Post
Thanks for picking up my support slack @jackie_w.
You keep 'slacking' by developing useful new stuff and I'll keep answering straightforward questions. Seems like a good division of labour to me!
jackie_w is offline   Reply With Quote
Advert
Old 09-02-2015, 07:51 AM   #48
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Hi DiapDealer

This looks to be an amazing plugin.

Have you thought of making an addition to replace paragraphs formed using break tags to those using paragraph tags? Would this fit into the theme of the plugin? Would you be interested in implementing such a feature if it did fit?

Example of what I mean:
Code:
Turn this:
...
This is a paragraph...<br />
<br />
This is another paragraph.<br />
<br />
... 

Into this:
<p>This is a paragraph...</p>
<p>This is another paragraph.</p>
Currently I use multiple fragile regex's, and hope I don't stuff it up...


Your thoughts?
sherman is offline   Reply With Quote
Old 09-02-2015, 12:42 PM   #49
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: 29,801
Karma: 54830978
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 sherman View Post
Hi DiapDealer

This looks to be an amazing plugin.

Have you thought of making an addition to replace paragraphs formed using break tags to those using paragraph tags? Would this fit into the theme of the plugin? Would you be interested in implementing such a feature if it did fit?

Example of what I mean:
Code:
Turn this:
...
This is a paragraph...<br />
<br />
This is another paragraph.<br />
<br />
... 

Into this:
<p>This is a paragraph...</p>
<p>This is another paragraph.</p>
Currently I use multiple fragile regex's, and hope I don't stuff it up...


Your thoughts?
IMHO Your fragile REGEX is probably a more robust REGEX because you tune it to your exact condition

<p> is simple

what if the first tag was a:
<div class="foo"> <span class="bar">
or
<p class="foo"> <span class="bar">

or the <br /> was inside another tag

<i>there she<br /> blows</i> (up )
theducks is offline   Reply With Quote
Old 09-05-2015, 07:38 AM   #50
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by sherman View Post
Hi DiapDealer

This looks to be an amazing plugin.

Have you thought of making an addition to replace paragraphs formed using break tags to those using paragraph tags? Would this fit into the theme of the plugin? Would you be interested in implementing such a feature if it did fit?


Currently I use multiple fragile regex's, and hope I don't stuff it up...


Your thoughts?
Glad you like the plugin. But I'm afraid any attempt to automate such a process is going to leave one "hoping they didn't stuff it up."

First and foremost, I create tools that I need/want for my own use; and happily share them with others who may be looking for similar tools. But I'm afraid I long ago grew tired of trying to "fix" ebook code that was so bad its paragraphs weren't clearly delineated. Now I just discard that sort of soup and look (or wait) for something better with which to start. I still like to spend more time reading ebooks than I do working on them, after all.

I think calibre's line unwrapping feature (part of its conversion options) does as admirable a job as any at this sort of thing, but there's always going to be some guessing and hoping (and proofing and reproofing) going on.

Last edited by DiapDealer; 09-05-2015 at 07:42 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 09-05-2015, 07:54 AM   #51
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by DiapDealer View Post
Glad you like the plugin. But I'm afraid any attempt to automate such a process is going to leave one "hoping they didn't stuff it up."

First and foremost, I create tools that I need/want for my own use; and happily share them with others who may be looking for similar tools. But I'm afraid I long ago grew tired of trying to "fix" ebook code that was so bad its paragraphs weren't clearly delineated. Now I just discard that sort of soup and look (or wait) for something better with which to start. I still like to spend more time reading ebooks than I do working on them, after all.

I think calibre's line unwrapping feature (part of its conversion options) does as admirable a job as any at this sort of thing, but there's always going to be some guessing and hoping (and proofing and reproofing) going on.
That's fair enough. I decided to try and make use of the 'regex functions'. I've got most of the way there, but some of my regex is still not quite right

I mainly come across this particular issue with some fanfiction (depends on the website) and webfiction (spacebattles, I'm looking at YOU).
sherman is offline   Reply With Quote
Old 09-06-2015, 01:26 AM   #52
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I assume you use the FanFicFare plugin?

...

There may be something the plugin author can do, if it is a fairly consistent variety of source input. Best to ask about in the plugin thread, though.

Always best to catch these things at the source, if possible.
eschwartz is offline   Reply With Quote
Old 09-06-2015, 01:48 AM   #53
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by eschwartz View Post
I assume you use the FanFicFare plugin?

...

There may be something the plugin author can do, if it is a fairly consistent variety of source input. Best to ask about in the plugin thread, though.

Always best to catch these things at the source, if possible.
Yeah, FanFicFare for the most part, although there are sometimes over places I've got online fic and it hasn't used proper paragraphing.
sherman is offline   Reply With Quote
Old 06-13-2016, 07:32 AM   #54
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 80
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
First of all, thanks for this useful plugin!

If I add a cover using the Calibre Editor tool and then I apply Editing Toolbag to any tag, epub-check finds an error on the titlepage (the one with the cover):
Code:
ERROR	RSC-005	/text/titlepage.xhtml
(line 16, col 53)	Error while parsing file 'attribute "preserveaspectratio" not allowed here; expected attribute "alignment-baseline", [...].
I can't really see the difference, but some modification to the file is applied.
senhal is offline   Reply With Quote
Old 06-13-2016, 08:23 AM   #55
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by senhal View Post
First of all, thanks for this useful plugin!

If I add a cover using the Calibre Editor tool and then I apply Editing Toolbag to any tag, epub-check finds an error on the titlepage (the one with the cover):
Code:
ERROR	RSC-005	/text/titlepage.xhtml
(line 16, col 53)	Error while parsing file 'attribute "preserveaspectratio" not allowed here; expected attribute "alignment-baseline", [...].
I can't really see the difference, but some modification to the file is applied.
I can confirm this problem. In certain circumstances, something in the plugin is changing preserveAspectRatio to preserveaspectratio.

In case it helps to track down the actual problem, I have seen it when trying to remove empty spans, even though there are no spans at all on a typical calibre svg-type cover page. I can work around the problem by running the Editor's Beautify option before running this plugin.
jackie_w is offline   Reply With Quote
Old 06-13-2016, 08:57 AM   #56
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll have to take a look. I know that at one point, my code was taking extra care to preserve all the special camelCased svg attribute names, but perhaps I inadvertantly did something to break that. Should be pretty easy to fix if it is indeed my fault. It's weird that no one noticed until now, though, if so. This version has been in place for a long, long time now.

EDIT: Looking at the code, it looks like an oversight on my part. Everything works fine if the svg attributes are cased properly to begin with, but not if they're already improperly cased in the source. @jackie_w: that explains why Beautifying before running the plugin resolves it. Should be a fairly easy fix.

Last edited by DiapDealer; 06-13-2016 at 09:09 AM.
DiapDealer is offline   Reply With Quote
Old 06-13-2016, 09:43 AM   #57
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by DiapDealer View Post
EDIT:... Everything works fine if the svg attributes are cased properly to begin with, but not if they're already improperly cased in the source.
I don't think this is correct. If you use the Tools - Add Cover option, the generated SVG code will have correctly-cased attributes. Running the plugin directly afterwards will mess-up the casing.

I believe the problem has something to do with the fact that the 'Add Cover' option creates
Code:
preserveAspectRatio="...">
on a new line. I tested this theory by changing the standard code so that
Code:
viewBox="..."
was also on a new line. Ater re-running the plugin both preserveAspectRatio and viewBox had changed to preserveaspectratio and viewbox.

Running Beautify before running the plugin removes the new lines.

Quote:
Originally Posted by DiapDealer View Post
It's weird that no one noticed until now...
My best guess is that a defective preserveAspectRatio attribute results in a default being used and perhaps the default is to assume preserveAspectRatio="xMidYMid meet", which is what most people would have set it to anyway. I only noticed the problem because I'm one of the Philistines who prefers preserveAspectRatio="none" for my covers
jackie_w is offline   Reply With Quote
Old 06-13-2016, 10:55 AM   #58
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes, being on a new line (after a linefeed character) could definitely trip up the plugin's tag/attribute-parsing routine. It's been a while since I've visited that. I'll have to experiment when I get in front of a PC. Thanks for investigating.
DiapDealer is offline   Reply With Quote
Old 06-13-2016, 09:00 PM   #59
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
After examining this issue, I'm thinking the simplest approach to fix it is to just exempt svg tags from scrutiny entirely. Otherwise, even after fixing the case issue, the plugin's parser is always going to alter svg tags that have extra spacing (including linefeeds and or carriage returns between its attribute/value pairs.

I can't imagine too many people are using this plugin to modify their svg wrappers to begin with.

Thoughts?
DiapDealer is offline   Reply With Quote
Old 06-14-2016, 06:52 AM   #60
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by DiapDealer View Post
I can't imagine too many people are using this plugin to modify their svg wrappers to begin with.

Thoughts?
Obviously I can't speak for anyone else's usage, but I've never needed or wanted to 'refine' any SVG code with this plugin. I only use it for <div> and <span>.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Diaps Editing Toolbag.zip Index Error phossler Editor 2 10-01-2014 08:05 PM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM
japi - a text editor capable of editing ePub directly hekkel ePub 5 02-20-2009 08:46 AM


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


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