Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2018, 12:36 AM   #1
davidspring
Junior Member
davidspring began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2018
Location: Seattle, Washington
Device: Sigil
Smile How to change the Sigil Images folder name to images

I have xhtml files that I have exported from LibreOffice that I would like to edit with Sigil and then import to my Joomla website. Joomla requires that all images be placed in a folder called “images”. I can create folders inside of the images folders to keep my images organized for example folders called images/chapter1, images/chapter2, etc. This makes the relative URL for Chapter 1 images: images/chapter1/image1name.jpg., etc. My relative URLs are correct in the Xhtml document I exported from Libre Writer. However, when the xhtml file is opened in Sigil, Sigil places all the images in a folder called Images and changes the relative URL for each image to Image/image1name.jpg, etc. I am hoping someone can tell me how to change the name of the Sigil Images folder from Images (upper case I) to images (lower case I). I am also hoping the developers of Sigil can change Sigil so that it does not change the relative URLs of images when importing an HTML or XHTML file - but instead uses the folder structure of the HTML or XHTML file. Thanks for your assistance in this important matter!
davidspring is offline   Reply With Quote
Old 02-05-2018, 05:48 AM   #2
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You can't. Sorry to be so brusque, but that's just how it is. Unless you can get someone to write an export plugin to parse all links looking for "Image" in them and replacing them with "image", there is no workaround.

There's a future envisioned for Sigil where it can work without needing to force a specific folder structure, but that future is not here.

Last edited by DiapDealer; 02-05-2018 at 05:54 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 02-05-2018, 03:34 PM   #3
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by davidspring View Post
I have xhtml files that I have exported from LibreOffice that I would like to edit with Sigil and then import to my Joomla website. Joomla requires that all images be placed in a folder called “images”. I can create folders inside of the images folders to keep my images organized for example folders called images/chapter1, images/chapter2, etc. This makes the relative URL for Chapter 1 images: images/chapter1/image1name.jpg., etc. My relative URLs are correct in the Xhtml document I exported from Libre Writer. However, when the xhtml file is opened in Sigil, Sigil places all the images in a folder called Images and changes the relative URL for each image to Image/image1name.jpg, etc. I am hoping someone can tell me how to change the name of the Sigil Images folder from Images (upper case I) to images (lower case I). I am also hoping the developers of Sigil can change Sigil so that it does not change the relative URLs of images when importing an HTML or XHTML file - but instead uses the folder structure of the HTML or XHTML file. Thanks for your assistance in this important matter!


Perhaps I'm just stupid--it's been suggested--but I don't yet see the relevance of Joomla to this? You are, apparently, exporting files/images from Libre Office, to Sigil, yes? And you make whatever edits you wish--although I don't see how that pertains to the images, but, carrying on--and then at some point, you have an ePUB, presumably the way you want it.

Why not simply unzip the ePUB, copy the folders, rename them "images" and regex the interior, and export same to Joomla? It's not as though Joomla has a native eReading app, last I looked?

Perhaps I misunderstand how Joomla plays into this. The "import/export" part of your discussion, thus far, seems to be LO to Sigil, for editing. Then you have an ePUB, in which, yes, the image folder is named Images.

At what point, and in what context, is the ePUB folder imported to Joomla? Is the entire ePUB imported? That doesn't seem right, because it would set up its own structure, presumably. Are you trying to create blog articles, or articles (of whatever name) for Joomla, using an ePUB? (Our CMS for our site is Joomla, so I have some passing familiarity with it--the CMS that's too "for dummies" to be fast and easy, and too rigid to be great for advanced CMS usage...(sigh))

If that's the case, I'd just unzip the ePUB. Rename the folders. Regex the HTML,and import. That's likely the fastest method, IF (that's the caveat), IF I understand what you are trying to do.

Is that what you're doing? Trying to create articles, in Joomla, using ePUB formats?


Hitch
Hitch is offline   Reply With Quote
Old 02-05-2018, 03:48 PM   #4
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I assumed (perhaps incorrectly) that the OP has a need to duplicate content from epubs on a Joomla website and was looking for a quick and easy one-source-suits-all editing solution. If that's not the case, and the epub is actually expendable, then my recommendation is to use other, more appropriate, software to create/edit website content.
DiapDealer is offline   Reply With Quote
Old 02-05-2018, 04:20 PM   #5
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by DiapDealer View Post
I assumed (perhaps incorrectly) that the OP has a need to duplicate content from epubs on a Joomla website and was looking for a quick and easy one-source-suits-all editing solution. If that's not the case, and the epub is actually expendable, then my recommendation is to use other, more appropriate, software to create/edit website content.
Well, sure, that too.

I am curious, now. If the OP will elaborate, perhaps the geniuses here () can aid and abet.

Hitch
Hitch is offline   Reply With Quote
Advert
Old 02-07-2018, 11:07 PM   #6
davidspring
Junior Member
davidspring began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2018
Location: Seattle, Washington
Device: Sigil
Friends,
I appreciate your feedback. My hope as one of you suggested was to find an easy way to not merely make an Epub but also to make an HTML document to copy paste into Joomla web pages. What I want Sigil for is to make minor edits to the HTML and CSS after exporting the HTML document from Libre Writer and before importing it to Joomla. It is not merely Joomla, but nearly all content management systems that place images in a folder called images. Needless to say, there is a huge difference between a folder called images and a folder called Images. It is also common practice to place images inside of sub folders inside of the main folders, thus images/category1/image01.jpg, etc is the most common way of naming images on the Internet. I worked very hard to find a way for Libre Writer to preserve my images structure when exporting images to an HTML document and the links I have in my HTML document are correct before opening the document in Sigil.

What I do not understand is why Sigil can not either preserve the image links the way they are or at the very least use the name images for the folder instead of Images. As a rule, image links should never use capital letters anywhere in the file name. I am sure there is a variable called Images somewhere in the code of Sigil - that is why the images folder has a capital letter I instead of a lower case letter. I am equally certain that the name for the images folder in Sigil can be changed to a lower case letter i by finding and renaming this variable to begin with a lower case i.

Other than the odd behavior of needlessly changing the file path on images, I really like Sigil. I do have several ways of working around the problem - such as opening the Epub. But my hope was not to cover up the problem but rather to permanently solve the problem. As it is, there is a coding error in Sigil which needs to be corrected. When I have more time, I will dig into the code and correct it. I was just hoping that someone here was already aware of this problem and already knew where to go in the code to fix this problem.

I do believe Sigil has the potential to act as a go between to help edit convert ed Libre Writer documents to HTML web pages that can then be used as Joomla web pages. But it will require solving the images folder naming problem. I will post the solution on this forum if and when I ever find that solution.
Regards, David
davidspring is offline   Reply With Quote
Old 02-07-2018, 11:35 PM   #7
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: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
A related issue: Sigil, on Windows, does not distinguish case in filenames.

Demonstrated by trying to rename a file from x.html to X.html, it will pop an error 'The filename "X.html" is already in use.'
I can work around that, e.g. name x to xx to X.

But I had a few days hairpulling when I made a file that worked perfectly in Windows, had no errors with the built-in F7 check, exported to Kindle OK, but loading to a Mac and iBooks, had missing images.
Eventually I used epubcheck and it told me there were missing references and I realised it meant there was a case mismatch in an img code.

I installed the epubcheck plugin and now use it religiously and won't be caught by this again.

I assume this is due to the underlying OS and that likely Sigil on Linux or OSX will not have this problem. But Sigil really should enforce case sensitivity in filenames so errors like this are not hidden.

Last edited by AlanHK; 02-07-2018 at 11:41 PM.
AlanHK is offline   Reply With Quote
Old 02-08-2018, 01:06 AM   #8
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Well...

You, @DavidSpring, see it as an "error." Not all of us do. I know that Kev and Diap will respond to this, so I won't try to presume, here--but Sigil is an ePUBcreation tool. It's not an "interim tool so person X can go from LibreOffice to HTML to Sigil to CMSY/Joomla." As an ePUB tool, it works perfectly fine, and the capitalization--or not--of the Images folder doesn't have a deleterious effect on the resulting ePUB.

There are tons of other XML editors out there; Oxygen, and Blue Griffon and the like. Perhaps one of those would suit your particular use better.

If Kev and Diap want to pore over that infamous "million-plus lines of code," that Sigil boasts, to fix this--when, to the best of my recollection, nobody else has had an issue with it--that, of course, is entirely up to them.

While we're at it, Sigil has an imposed folder structure. IF someone makes their own ePUBs, using something else, or from scratch, their folder structure might be completely different than Sigil's. Should we alter that, too? Because a user might, or because some user does, have a different folder structure, that he got when he used Epsilon, let's say, to work on his ePUB?

At least be straight up about it--your use is hardly routine, for a piece of software specifically designed to make ePUBs, in toto, as whole items, rather than an XHTML editor that's intended to be a piece of a larger software process.

Hitch
Hitch is offline   Reply With Quote
Old 02-08-2018, 03:46 AM   #9
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
With the Calibre editor, you will not have that problems.
jbacelar is offline   Reply With Quote
Old 02-08-2018, 09:50 AM   #10
davidspring
Junior Member
davidspring began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2018
Location: Seattle, Washington
Device: Sigil
Friends,
I agree that if the only goal of Sigil is to produce a clean Epub, then there is no need to change the case of the images folder. However, as a person who has spent more than 20 years teaching courses in HTML and CSS, I think it is better to follow the normal practice on the Internet of using lower case letters for folders dealing with images. I may be the first person to bring this topic up. But it does not make it any less important of a topic. When one is dealing with a 400 page book with hundreds of images in dozens of folders, it is important to have a well organized images folder structure. Sigil can and should honor a well organized folder structure just as it already honors a well organized series of headings. Replacing the existing images folder structure with one that does not work on common websites is not a good practice any more than it would be to replace the heading structure of an HTML document.

As for type of computers, I use Linux but that should have no bearing on the images file naming in Sigil.

Finally, as for Calibre, it unfortunately trashes both the CSS and HTML creating dozens of un-necessary and poorly named CSS classes. For years, I have asked my students to write clean code. What I like about Sigil is the HTML and CSS are much better than Calibre.

Again, I do have several options to work around this problem and someday when I get the time, I will go through the million lines of code, find where the error was made and offer a fix for it. I realize that most of you have other priorities. So please do not worry too much about it. Sigil is an excellent tool if the only goal is creating an Epub and I really appreciate it for that purpose.
Regards,
David
davidspring is offline   Reply With Quote
Old 02-08-2018, 09:57 AM   #11
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: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, given the infinite number of fixed layouts downstream software could have or need, we will not be changing Sigil's current policy on naming to match something not e-book related. Sigil works properly to create epub2 and epub3 epubs and is not meant to be a general purpose html editor.

In the long run we will look into allowing any structure, but this will require a massive reworking of the BookBrowser and tracking down every single assumption about directories hard coded now in both the entire Sigil codebase and the plugin interface.

Right now, you can create an output plugin to rearrange the epub content and fix links/urls if you so desire. It is a very doable project.

Last edited by KevinH; 02-08-2018 at 10:00 AM.
KevinH is offline   Reply With Quote
Old 02-08-2018, 10:06 AM   #12
davidspring
Junior Member
davidspring began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2018
Location: Seattle, Washington
Device: Sigil
Thank you Kevin. I agree entirely and I will likely write such a plugin when I get the chance as it would certainly help people like me interested in extending Sigil. Keep up the good work.
Regards,
David
davidspring is offline   Reply With Quote
Old 02-08-2018, 10:07 AM   #13
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by davidspring View Post
Friends,
I agree that if the only goal of Sigil is to produce a clean Epub, then there is no need to change the case of the images folder.
That is indeed Sigil's reason for being. There are plenty of website/html editors that will work better for creating/maintaining web content. As Kevin (and I) mentioned, allowing users to maintain any internal structure they like within an epub is a future goal of ours for Sigil. But there's a heck of a lot more involved in getting there than searching the code-base and replacing "Image" with "image".

Last edited by DiapDealer; 02-08-2018 at 10:10 AM.
DiapDealer is offline   Reply With Quote
Old 02-08-2018, 10:31 AM   #14
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: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Slight correction: *Windows* does not distinguish case in filenames in its main filesystem. This has nothing to do with Sigil. There is no way for Sigil to enforce case-sensitivity on Windows!

Linux does distinguish case, and Mac OSX does come with alternate filesystems that are case-sensitive. I use one on my own OS X machine.

In other words: filename.ext == FILENAME.EXT == FiLeNaMe.ExT on the default Windows filesystem and asking to load any of them will in fact load the exact same file. It impacts all software on Windows including browsers used to load local files. There is nothing Sigil can do to "fix" this. And yes, epubcheck can look for this issue to help prevent problems on "real" computer operating systems ;-).



Quote:
Originally Posted by AlanHK View Post
A related issue: Sigil, on Windows, does not distinguish case in filenames.

Demonstrated by trying to rename a file from x.html to X.html, it will pop an error 'The filename "X.html" is already in use.'
I can work around that, e.g. name x to xx to X.

But I had a few days hairpulling when I made a file that worked perfectly in Windows, had no errors with the built-in F7 check, exported to Kindle OK, but loading to a Mac and iBooks, had missing images.
Eventually I used epubcheck and it told me there were missing references and I realised it meant there was a case mismatch in an img code.

I installed the epubcheck plugin and now use it religiously and won't be caught by this again.

I assume this is due to the underlying OS and that likely Sigil on Linux or OSX will not have this problem. But Sigil really should enforce case sensitivity in filenames so errors like this are not hidden.

Last edited by KevinH; 02-08-2018 at 10:33 AM.
KevinH is offline   Reply With Quote
Old 02-08-2018, 12:43 PM   #15
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by davidspring View Post
Friends,

Finally, as for Calibre, it unfortunately trashes both the CSS and HTML creating dozens of un-necessary and poorly named CSS classes. For years, I have asked my students to write clean code. What I like about Sigil is the HTML and CSS are much better than Calibre.


Regards,
David
Don't confuse Calibre's conversion engine with Calibre's editor. I agree that nobody at my shop is allowed to use Calibre, for conversion--but I have two different areas that absolutely will use the editor--which creates no named classes, etc.

That might be a route for you, assuming, as an instructor of HTML and CSS, you are not using Sigil's WYWIWYG editing, but instead, merely using it to create the OPF, etc.

Hitch
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch images folder content (problem?!) Geco Kobo Reader 19 07-11-2013 01:02 AM
Copying Sigil Images Folder EditorOne Sigil 5 06-08-2013 08:50 PM
Images with Sigil Gerlyn ePub 2 02-08-2012 01:05 PM
Images directory in entry' folder Perkin Calibre 10 02-07-2011 09:22 PM
Images Folder - Resize files Fossil Sigil 9 07-24-2010 11:36 AM


All times are GMT -4. The time now is 04:13 AM.


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