MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Can't open epub file (https://www.mobileread.com/forums/showthread.php?t=340005)

jonesyb 06-17-2021 12:00 PM

Quote:

Originally Posted by odamizu (Post 4130535)
If your goal is to learn how to put together an epub and remove the Calibre part of the process, skip Calibre altogether and go straight to Sigil.

You can start with almost any type of file (html, txt, docx, etc.), import them into Sigil (using import plugins when necessary), then build your epub from there.

Download Sigil User Guide here: https://github.com/Sigil-Ebook/sigil...tag/2021.05.27

See Tutorial section in particular to learn how to put together an epub. The chapter "Prepare Your File For Sigil" discusses how to import various file formats into Sigil. There is also a "Manage Plugins" chapter that explains how to use plugins.

I just read the Sigil user guide. Awesome stuff thanks.

jonesyb 06-17-2021 12:11 PM

So now I have a better understanding of Sigil and how it works, I have a question.

Say I have a fully formatted html book in one html file (actually I do, this is not hypothetical). It includes a HTML TOC, and a decent sized appendix. Also all the CSS.

Is there a way of importing it and splitting it up in to sections without having to manually edit all the appendix links and TOC links etc?

I had a look through the plugins but I could not see anything.

Anyway I am just going to make a copy of a book to mess around with and see how I get on.

This question now is not on topic for the original thread I created. Should I create a new one or is it OK in here?

DiapDealer 06-17-2021 12:20 PM

Quote:

Originally Posted by jonesyb (Post 4131051)
Say I have a fully formatted html book in one html file (actually I do, this is not hypothetical). It includes a HTML TOC, and a decent sized appendix. Also all the CSS.

Is there a way of importing it and splitting it up in to sections without having to manually edit all the appendix links and TOC links etc?

Yes.

Quote:

Originally Posted by jonesyb (Post 4131051)
I had a look through the plugins but I could not see anything.

It's inherent to Sigil itself. No need to use plugins.

If you use Add File to add your existing html to a blank epub, it will pull in the css file as well (as long as the link to it is valid). After that, it's a matter of using the built in Split feature and adding the ToC semantic. Add File(s)/Splitting/Merging and adding semantics are things that are documented in the user guide.

But yes: feel free to start a new thread if you want some assistance in using these various Sigil features.

jonesyb 06-17-2021 12:30 PM

Quote:

Originally Posted by DiapDealer (Post 4131056)
Yes.


It's inherent to Sigil itself. No need to use plugins.

If you use Add File to add your existing html to a blank epub, it will pull in the css file as well (as long as the link to it is valid). After that, it's a matter if using the built in Split feature and adding the ToC semantic. Add File(s)/Splitting/Merging and adding semantics are things that are documented in the user guide.


Thank you! Fully appreciated. I will crack on and see what happens.

jonesyb 06-17-2021 03:33 PM

Well that was an easy process. I have completed my mission.

Thank you for all your help everyone.

odamizu 06-17-2021 07:44 PM

Quote:

Originally Posted by jonesyb (Post 4131123)
Well that was an easy process. I have completed my mission.

Thank you for all your help everyone.

:thumbsup:

@DiapDealer — now that the User Guide has been updated for 1.6.0+, would you consider putting a link to the User Guide in the Links section of the Sigil GitHub page, perhaps before or after the link to the MobileRead? Also maybe highlight the User Guide more prominently on the Sigil website Documentation page?

DiapDealer 06-17-2021 07:59 PM

Quote:

Originally Posted by odamizu (Post 4131183)
:thumbsup:

@DiapDealer — now that the User Guide has been updated for 1.6.0+, would you consider putting a link to the User Guide in the Links section of the Sigil GitHub page, perhaps before or after the link to the MobileRead? Also maybe highlight the User Guide more prominently on the Sigil website Documentation page?

Sure. It's in the important links section of the Sigil github wiki, but I can add a link to the main readme if you think it will help.

But what would you suggest for making it more prominent on the documentation page? The link is already there. In my experience, it's not a problem of the link not standing out. The problem is they simply don't read the documentation page. Or any of the pages, really. For a large portion of the people who can't find the user guide, I've found that it's typically because the darn thing simply refuses to fall out of the sky and into their laps. ;)

odamizu 06-18-2021 12:51 AM

Quote:

Originally Posted by DiapDealer (Post 4131185)
Sure. It's in the important links section of the Sigil github wiki, but I can add a link to the main readme if you think it will help.

But what would you suggest for making it more prominent on the documentation page? The link is already there. In my experience, it's not a problem of the link not standing out. The problem is they simply don't read the documentation page. Or any of the pages, really. For a large portion of the people who can't find the user guide, I've found that it's typically because the darn thing simply refuses to fall out of the sky and into their laps. ;)

Ha! I didn't even remember there was a Wiki! :)

Anyway, when I went searching for a link to the User Guide for jonesyb, it took a lot of clicking for me to find it, whereas links to MobileRead were prominently posted everywhere, which is why I think people come here first and don't even realize there is a User Guide. If a link to the User Guide were posted wherever there is a link to MobileRead, more people might try the User Guide first (if that's even your goal).

For the Documentation page, if you want people to check the User Guide before asking on MobileRead, I suggest making that the first paragraph rather than the last. As it is, the first paragraph says: "Please consider the Sigil User Forums at Mobileread to be the primary resource for getting help with your Sigil questions." If I read that, I'd stop reading right there and click the Mobileread link, never making it to the last paragraph.

Also, you might attach a link to "Sigil User Guide" so that it's highlighted and clickable and make it capitalized and bold. That would make it more noticeable.

Code:

<p>The latest release of the <a href="https://github.com/Sigil-Ebook/sigil-user-guide/releases/latest"><strong>Sigil User Guide</strong></a> can always be found <a href="https://github.com/Sigil-Ebook/sigil-user-guide/releases/latest">in its own repository</a> (in EPUB format), as well as in the <a href="https://github.com/Sigil-Ebook/Sigil/tree/master/docs">docs directory</a> of the source tree.</p>

DNSB 06-18-2021 12:56 AM

Quote:

Originally Posted by DiapDealer (Post 4131185)
Or any of the pages, really. For a large portion of the people who can't find the user guide, I've found that it's typically because the darn thing simply refuses to fall out of the sky and into their laps. ;)

<sarcasm>What? The installer does not install the user guide and automatically open it after the install? What kind of user hostile software are you creating?</sarcasm>

hobnail 06-18-2021 01:11 AM

Quote:

Originally Posted by jonesyb (Post 4131051)
Is there a way of importing it and splitting it up in to sections without having to manually edit all the appendix links and TOC links etc?

If you're consistent with your chapter titles, for example, I use h2 tags for chapter titles then you can use Sigil's insert split marker (ctl+shift+return) to have as a copy of what you're going to replace/change to. E.g., insert it just after the body line. Select the entire line with the split marker, ctl+x to cut it, then go down to the search and replace and put it in the Replace: box at the bottom. Above it in the Find: box put <h2, then in the Replace: box add that same <h2 at the end of the Replace: box. So then when you do replace all, all of the <h2s become split markers with an <h2 at the end of their line (or maybe on the next line). You can then use Mend and Prettify to add in line breaks after the split markers. Then do Split at Markers (f6). If you get it right you can have the .xhtml file names match the chapter numbers.

Tex2002ans 06-18-2021 02:08 AM

Quote:

Originally Posted by DNSB (Post 4131219)
<sarcasm>What? The installer does not install the user guide and automatically open it after the install? What kind of user hostile software are you creating?</sarcasm>

What? You mean the thing you're supposed to immediately click through as fast as possible and X right out of? :D

Quote:

Originally Posted by hobnail (Post 4131223)
If you're consistent with your chapter titles, for example, I use h2 tags for chapter titles then you can use Sigil's insert split marker (ctl+shift+return) to have as a copy of what you're going to replace/change to.

:thumbsup:

Insert > Split Marker (Ctrl+Shift+Enter) places this code within your EPUB:

Code:

<hr class="sigil_split_marker" />
then pressing Edit > Split At Markers (F6) splits the HTML files wherever that code is placed.

Or, like you mentioned, this can be done on a mass scale by using Search/Replace:

Search: <h2
Replace: <hr class="sigil_split_marker" /><h2

This looks for all "<h2" (or whatever else you use for chapter titles), then a simple F6 splits your entire book in one shot. :)

* * *

Example Code:

Original:

Code:

<p>Dedicated to jonesyb</p>

<h2>Chapter 1</h2>
<p>It was a dark and stormy night.</p>
<h2>Chapter 2</h2>
<p>I woke up in bed.</p>

After S&R (or manually placing splits):

Code:

<p>Dedicated to jonesyb</p>

<hr class="sigil_split_marker" /><h2>Chapter 1</h2>
<p>It was a dark and stormy night.</p>
<hr class="sigil_split_marker" /><h2>Chapter 2</h2>
<p>I woke up in bed.</p>

After F6:

Code:

<p>Dedicated to jonesyb</p>
Code:

<h2>Chapter 1</h2>
<p>It was a dark and stormy night.</p>

Code:

<h2>Chapter 2</h2>
<p>I woke up in bed.</p>


jonesyb 06-18-2021 02:09 AM

Quote:

Originally Posted by DiapDealer (Post 4131185)
For a large portion of the people who can't find the user guide, I've found that it's typically because the darn thing simply refuses to fall out of the sky and into their laps. ;)

maybe this is...erm... is directed at me here.

OK I admit, I can not remember how hard I looked for a user guide.

In fact, or at all. I am not very familiar with github at all. I am not sure it even crossed my mind. My idea was to just open sigil and use it. Or something like that.

But thank you. It has been fun learning this new software. I really like it.

jonesyb 06-18-2021 02:12 AM

Quote:

Originally Posted by hobnail (Post 4131223)
If you're consistent with your chapter titles, for example, I use h2 tags for chapter titles then you can use Sigil's insert split marker (ctl+shift+return) to have as a copy of what you're going to replace/change to. E.g., insert it just after the body line. Select the entire line with the split marker, ctl+x to cut it, then go down to the search and replace and put it in the Replace: box at the bottom. Above it in the Find: box put <h2, then in the Replace: box add that same <h2 at the end of the Replace: box. So then when you do replace all, all of the <h2s become split markers with an <h2 at the end of their line (or maybe on the next line). You can then use Mend and Prettify to add in line breaks after the split markers. Then do Split at Markers (f6). If you get it right you can have the .xhtml file names match the chapter numbers.

I also use h2s for my chapters and this would work nicely. Thanks for the tip.

jonesyb 06-18-2021 02:12 AM

Quote:

Originally Posted by Tex2002ans (Post 4131229)
What? You mean the thing you're supposed to immediately click through as fast as possible and X right out of? :D



:thumbsup:

Insert > Split Marker (Ctrl+Shift+Enter) places this code within your EPUB:

Code:

<hr class="sigil_split_marker" />
then pressing Edit > Split At Markers (F6) splits the HTML files wherever that code is placed.

Or, like you mentioned, this can be done on a mass scale by using Search/Replace:

Search: <h2
Replace: <hr class="sigil_split_marker" /><h2

This looks for all "<h2" (or whatever else you use for chapter titles), then a simple F6 splits your entire book in one shot. :)

This is super useful, thank you!

jonesyb 06-18-2021 02:13 AM

I converted my first book yesterday using Sigil. It and it worked great. Now I am going to go back and do all the rest of them and see what else I can learn along the way.

Thanks again


All times are GMT -4. The time now is 10:31 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.