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 12-16-2021, 12:50 PM   #106
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 16,954
Karma: 82522897
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Kobo Forma, Kobo Clara HD, Lenovo M8 FHD, iPad Pro, Tolino
Quote:
Originally Posted by CalibUser View Post
@RbnJrg: I think your suggestion would need a different plugin; it is relatively easy to insert a new page in an ePub using Sigil, but I think your suggestion would require the ePub to be unzipped so that an existing page could be modified to incorporate the svg wrapper and then zipped up again.
Given that Sigil already needs to unzip and rezip the html/xhtml files to edit them?. It is not as if @RbnJrg was asking Sigil to insert the image into a random unopened for editing epub. Hmm... I don't think he was asking for that capability...
DNSB is offline   Reply With Quote
Old 12-16-2021, 02:54 PM   #107
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,292
Karma: 5625799
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by CalibUser View Post
@RbnJrg: I think your suggestion would need a different plugin; it is relatively easy to insert a new page in an ePub using Sigil, but I think your suggestion would require the ePub to be unzipped so that an existing page could be modified to incorporate the svg wrapper and then zipped up again.
Many thanks for your answer. I think I did not explain myself very well. I have this .xhtml page:

Click image for larger version

Name:	Image1.png
Views:	19
Size:	164.7 KB
ID:	190859

As you can see, there are two paragraphs of text. And between them, I want to add a svg wrapper, so the output would be something as:

Click image for larger version

Name:	Image2.png
Views:	23
Size:	544.7 KB
ID:	190860

What I'm seeking is that the wrapper is inserted where I have the cursor, not in a new .xhtml page; in the example I would have the cursor here:

Click image for larger version

Name:	Image3.png
Views:	19
Size:	169.1 KB
ID:	190861

Can your plugin do something so?
RbnJrg is offline   Reply With Quote
Old 12-16-2021, 03:38 PM   #108
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: 5,929
Karma: 4217884
Join Date: Nov 2009
Device: many
Cursor position is not passed to any plugin. So the only possibilities is for any plugin to do this would be:

1. The Plugin will add image file to epub and copy the required svg and any xhtml pieces needed to your clipboard, so that the user can just paste it once the plugin returns.

or

2. The user adds a unique placeholder to tell the plugin where you want the svg to be inserted. Something like:
Code:
<!-- PLUGIN INSERT SVG HERE -->
You could create a clip to insert that easily anyplace you want

Then the plugin would have to be modified to look for that placeholder and replace it with the required svg.



Either of these approaches could work to accomplish what you want but this up to the plugin dev if to implement if they want.

Last edited by KevinH; 12-16-2021 at 03:40 PM.
KevinH is offline   Reply With Quote
Old 12-16-2021, 07:21 PM   #109
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,292
Karma: 5625799
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
Cursor position is not passed to any plugin. So the only possibilities is for any plugin to do this would be:

1. The Plugin will add image file to epub and copy the required svg and any xhtml pieces needed to your clipboard, so that the user can just paste it once the plugin returns.

or

2. The user adds a unique placeholder to tell the plugin where you want the svg to be inserted. Something like:
Code:
<!-- PLUGIN INSERT SVG HERE -->
You could create a clip to insert that easily anyplace you want

Then the plugin would have to be modified to look for that placeholder and replace it with the required svg.



Either of these approaches could work to accomplish what you want but this up to the plugin dev if to implement if they want.
Thanks Kevin. Any of those possibilities are ok to me; perhaps, the first alternative is easier to implement. In fact, so far what I'm doing is to let the plugin create a new .xhtml sheet with the svg wrapper, to copy it, to paste it in the place where I want it to be, and finally to delete the sheet created by the plugin.
RbnJrg is offline   Reply With Quote
Old 12-17-2021, 02:47 AM   #110
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 606
Karma: 308286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by RbnJrg View Post
option to insert the svg wrapper not in a new .xhtml file but in the page (file)
What I do is create an SVG file and then copy the code between the divs, paste to the file where I want to put the illustration; then delete the original SVG file.

I add a class to the div wrapper:
div.breakavoid {page-break-inside: avoid;}

Or for smaller images you could use one with margins, to separate it from text, or size it.

PS -- I see from later posts you already worked that out, but leaving this as the div styling might be useful.

Last edited by AlanHK; 12-17-2021 at 02:51 AM.
AlanHK is offline   Reply With Quote
Old 12-19-2021, 09:21 AM   #111
CalibUser
Groupie
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 186
Karma: 62230
Join Date: Jul 2015
Device: Sony
@RbnJrg: I have updated the plugin to paste an image with svg tags into an ePub, following the suggestion by KevinH.

You can apply a div class to the wrapper, if required, as suggested by AlanHK.
CalibUser is offline   Reply With Quote
Old 12-19-2021, 11:39 AM   #112
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,292
Karma: 5625799
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by CalibUser View Post
@RbnJrg: I have updated the plugin to paste an image with svg tags into an ePub, following the suggestion by KevinH.

You can apply a div class to the wrapper, if required, as suggested by AlanHK.
Thank you very much CalibUser!
RbnJrg 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
Wrap in SVG plugin? gezginrocker Plugins 18 07-05-2015 01:20 AM
svg image on top of a background png image roger64 ePub 25 04-24-2015 12:00 PM
Display of a png image linked to a svg image roger64 Editor 6 03-13-2015 07:21 AM
Image wrap test Jellby ePub 15 05-04-2011 03:30 PM
Combining blockquote with image wrap WRB Sigil 1 02-12-2011 08:46 PM


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


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