Quantcast
Channel: MobileRead Forums - Sigil
Viewing all 3441 articles
Browse latest View live

[Plugin] StyleBender

$
0
0
Manipulates styling at block level in both epubs and imported html docs

Requirements
Plugin Type: Edit
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows 7, 8 & 10
Current Version: "0.1.1"
*** Tested on Windows 7, 8 & 10 ***
*** Untested on OSX, Linux32 and Linux64 ***

Installation
* Select Manage Plugins from the Plugins menu. In the dialog box, select either the Bundled Python or the External Python(Python 3.4+ should be installed on your computer to run this plugin externally).

* Click Add Plugin and select StyleBender_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run using Plugins > Edit > StyleBender

Description
This is an edit plugin that gives you various options to move or remove html styles, inline styling and create stylesheets at block level. This plugin can also be used for for both epubs and imported html docs. If you use html docs with this plugin please ensure that they are derived only from the following doctypes: Word doc and docx(html filtered only), ODF(OO and LO docs only), GoogleDoc(as html, zipped) or AbiWord.

To load an html doc into Sigil, first open Sigil and go to Edit > Tools > Preferences > General Settings > Mend XHTML Source Code On: and set this to Open and then save it(you only have to do this once). Now you can load the html file in the normal way using File > Open(ensure File Types is set to html).

User Options(via dialog)
-- Move the html <style> section & all inline styling to new stylesheets (imported html only)
-- Move only the html <style> section to a new stylesheet (imported html only)
-- Move only the inline styling to a new stylesheet (imported html only)
-- Remove all html styles(classes) from the html
-- Remove all inline styling from the html
-- Remove all tag attributes from the html

Plugin Run
First load your epub or html doc into Sigil and then just run this plugin.

Comment
For best results and to avoid problems I would also advise that you should always run the CustomCleanerPlus plugin before running the StyleBender plugin. Using the CustomCleanerPlus plugin will ensure that the html code is epub 2 compliant which will also help to greatly reduce validation errors further on down the line when you run Epubcheck. I specifically created these two plugins to help save some cleanup and formatting time for those folks who prefer creating their epub ebooks in raw html using Sigil.

Changes

Spoiler:

v0.1.1
-- Removed OSX and Linux restrictions in plugin.xml.
v0.1.0
-- Initial release

Attached Files
File Type: zip StyleBender_v011.zip (947.8 KB)

T.O.C in wrong place?

$
0
0
I've just created an ebook in Sigil and published on Kobo.

One error and I wonder how I might fix it? The automatic Table of Contents inserted itself in between chapters 1 and 2. It should be before Ch. 1. Yes?

Is there a way to rectify this? I never saw anything in Sigil that stipulated where it should go, but someone here may know.

Strange bug after switching from another app

$
0
0
Sigil 0.9.8 with OS X 10.11.6
  1. Sigil Document open, text window frontmost, cursor anywhere on page.
  2. Switch to any other application.
  3. Switch back to Sigil by any method.
  4. A capital S is inserted at the cursor every time. Sometimes the cursor moves down one or more lines before the S is inserted.
  5. The problem continues after multiple restarts and shutdowns.

I have tested many applications. This ‘S’ problem does not occur.
I am using Desktops (Spaces—I wish Apple would use just one term.). I don’t know if that matters. I know how to turn Desktops off, but I don’t want to lose all my application settings.

Has anyone else seen this? If not, then I’ll assume that parts of my OS are corrupt.

automatic index generation

$
0
0
is there a way to automatically generate indexes the same way we can automatically generate table of contents? i am wondering because i have a large ePUB where H1 tags are in the TOC, but it would be too unwidely to also include H2 and H3 tags, which I would like as (two separate) indexes... Is that possible?

Embedded font problem

$
0
0
Recently I downloaded an epub book and found a myriad of fonts in the various classes in the stylesheet. Normally I deal with this by changing them to "Arial" (my favorite obviously!) and that solves it.

For this book I had to change seven fonts, which were all that were showing in the twenty-nine categories. BUT, on going back to book view, nothing else had changed at all (in the twenty-two classes without specific font families being listed)!!. In the past I have looked for (and usually found....) 'inherit' which has been clogging things up but there was no sign of 'inherit' here.

I even tried (after changing the seven fonts) using Calibre to convert epub to epub: that too has worked in the past. This time - no joy!!

My only workaround has been to manually enter ' font-family: "Arial"; ' in EACH of the twentynine classes . . . .

Any ideas where the embedded fonts might be hiding?? I think I've looked everywhere.

PV window size

$
0
0
Howdy - just mullin' over a possible change to sigil....

I wasn't able to find a way to set the PV window to a specific size. Yes, I could drag the corners/sides, but I couldn't tell the exact size of the window in pixels.

It would be nice to set that window to my target device display size (eg iphone 7+: 1080 x 1920 pixels) so that I can get a better feel for how the book will flow.

Ideally there would be an area in preferences where I could select the default size of the window from a list of common devices, or set a custom size... it would default to that size when un-docking from the main sigil window, or when the PV view is first selected.

If that is not feasible, is it possible to include the window size in the header or status bar so I can drag it to the proper dimensions?

Thanks!

Sigil 0.9.8 changes in-line style codes

$
0
0
I have chapters with:
<body style="my style choices">
<p>My text 1.</p>
<p>My text 2.</p>
etc.

Sigil repeatedly changes that to:
<body>
<p style="my style choices">My text 1.</p>
<p style="my style choices">My text 2.</p>
etc.

It does this for some chapters in my book but not others. I can find no explanation for this bizarre behavior. Any ideas?

Sigil crashes on error in metadata, content.opf

$
0
0
Hello all,

I'm using Sigil ver 0.9.8, Qt ver 5.6.1 on kubuntu 16.04.2 LTS (Xenial Xerus).

I was creating an epub and editing the content.opf, which included adding additional metadata copied from an external file. After adding the metadata, on saving, sigil crashed and the error message popup was blank (sigil having locked up before printing the actual error message).

I repeated my steps, with the same result. On one occasion, the error message was printed, and it said something like "internal Python error" but of course the details button was inactive.

After starting again and adding the metadata one line at a time, I identified the following line as the culprit: (the names have been changed to protect the innocent.)

Code:

<dc:contributor opf:role="art" opf:file-as="Rockwell, Norman>Norman Rockwell</dc:contributor>
Note the missing quote between Norman and >.

When changed to :
Code:

<dc:contributor opf:role="art" opf:file-as="Rockwell, Norman">Norman Rockwell</dc:contributor>
it saved without error.

Given that I'm no stranger to missing quote marks, hopefully something can be done to provide a more gentle response to this error. ;)

ETA: Of course I haven't tested this on other platforms, but if it really is an "internal python error" it seems likely that the error will extend across platforms.

All the best,
Albert

toc.ncx problems in SIGIL

$
0
0
I'm totally baffled...

The generate Table of Contents button in SIGIL just stopped working for me, when I press it, instead of creating a toc.ncx file from my headings it just hangs the program until I press ESC, and the toc.ncx is still only the generic "Start".
I tried redoing epubs I had done before where SIGIL did generate a proper toc.ncx, but it still doesn't work.
I uninstalled SIGIL and reinstalled, and still no change.
I uninstalled and installed the latest 0.9.8 version, and it still doesn't work...
I've done hundreds of epubs with SIGIL generating a toc.ncx from the headings without any problem... and suddenly nothing?

Can anybody offer any help at what might be wrong?

epub3 to epub2

$
0
0
Is there a reliable way to convert epub3 to epub2?

I know that information may theoretically be lost; I'm fine with that.

Sigil acts weirdly in some files that have epub3 features. And if I do epubcheck it spews out hundreds of errors, though the file may display fine in practice, making it useless to diagnose real problems.

Small bug report

$
0
0
Found a bug-ish.

When you try and merge a file into the previous file by right clicking on the filename in the book browser and selecting merge - or typing ctl-m - I get an "Embedded Python Error". With a "Error: traceback report is missing" detail.

When you close/cancel the error report the merge is completed properly.

Windows 10 64, Sigil 0.9.7

Kindle Reviewer 3 says there's no TOC. How to fix??? TOC

$
0
0
I'm so tired it took me twenty minutes to find the "New Thread" button. lol Could it be any smaller?

The question is how do I get Kindle Reviewer 3 to recognize the toc in my book so the export will be correct? It reports there is no toc.

I'm at the end of a long journey creating my first ePub/mobi, and I can't seem to get over this one last hurdle without help. Here's what's going on:

I created a very simple TOC for my book on the toc.xhtml page (I guess that's where I was supposed to put it).

When I open the file in Kindle Previewer 3, the TOC page is there and the links all work perfectly, but the TOC panel on the Previewer says there is no TOC for this book! This is what I need to fix.

Thanks for any help.

Cover icon in Kindle library

$
0
0
This refers to my personal local use, not books from Amazon.

ePubs saved in Sigil and then exported as mobi files from KP3 have a dark gray generic icon in my kindle library.

But if the ePub was exported from InDesign, the icon is the cover of the book.

Is there some settings I can make in Sigil to set the cover as the book's icon?

Thanks!

Calculating and inserting image width. A plugin?

$
0
0
Hi

Sigil is very handy namely for its plugins, this explains the title I gave to this thread.
It is about calculating and inserting image width.

Rationale: we have two kinds of images: the fullscreen ones and the others.

1. - A fullscreen image is very safely contained in its own page.

I tend to use this very basic code (example):
Spoiler:

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Whatever</title>
<style type="text/css">body { margin:0 }</style>
</head>
<body>
<div style="text-align:center"><img alt="002" id="fig-2" src="../Images/Image-02.jpg" style="width: 80%;"/></div>

</body>

</html>


2. - A plain image will just flow with the text:
We'll use only a part of the above code.
Code:

<div style="text-align:center"><img alt="002" id="fig-2" src="../Images/Image-02.jpg" style="width: 60%;"/></div>
For both kinds of images, the width calculation to perform will be the same.

The percentage of width (here in bold) is truly the crucial figure. The more precise, the better display. Obviously it can't be more than 100%.

This how I calculate width for an image of a 626 × 942 pixels size to obtain 88.6%
(626/942) ×4 /3

I wish this could be done and inserted automatically for all images of an Epub.

If one does not agree with the 4/3 fraction (because his(her) own screen may have a different size), this fraction could be defined as a variable.

Where are the spaces going?

$
0
0
I've had this problem on and off for some time , but it's getting a bit annoying.

I have a book with dleiberate space lines in it: say (<p class="calibre8">& nbsp;</p>) or (<p class="calibre8">& #160;</p>) as a deliberate space line. At some stage I return to the page and find that the space symbol has gone - which means the line no longer produces a space once in book view!! At the same time ALL other space symbols have gone from the whole document . . .

It appears to happen randomly even though I know it can't be the case. I have Sigil set to "automatically clean......." on 'open', and also set to 'pretty print tidy'.

Sigil default styles in Android Epub readers

$
0
0
(1) I have been using Sigil as an authoring tool but notice that when using the Aldiko epub reader for Android that words marked for indexing are underlined, but when pressed do not go to the index. Is there some fix for this, e.g. - auto linking to the index on clicking or overriding the underlining for index hyperlink markups? Stylistically, this makes reading the document annoying. The document passes www3c and epub3 validation.

(2) To the Sigil generated document compatible with mobile epub readers, is there a default stylesheet url that links to the base Sigil styles, e.g. something similar to the declaration:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Or would such a step be redundant?

Thanks, Kurt

Questions about Sigil INI

$
0
0
I am on Windows 8.1.
I am using an old PortableApps version 8.6, so I don't know if these issues are due to the PortableApps wrapper, or to the age of the Sigil app.

I have problems getting the INI to retain my setting for Code View Font-- although my preferred font Monaco is installed in the Windows font folder, it does not appear in the GUI font selection list (which I don't understand, as other "non-standard" fonts do appear in the list). So with Sigil closed, I edit the INI manually. But it would frequently revert to default Courier. I discovered several months ago, that any changes to preferences in the GUI, such as changing the Pretty Print settings, or selecting a different spell-check dictionary, would reset the Code View Font automatically. So now I just manually edit again.

But last night I had a new experience --- Notepad froze while loading the INI, and no wonder! It had grown to over 6 MB! When I finally got it open, it seems that it was storing a ton of clipboard history. This history looked like several sessions worth of info. I deleted manually, opened Sigil again, and did some more editing. When I shut down, yup, new clipboard history was stored in the INI, which stood at 1.6 MB.

I don't know if the INI has always stored clipboard history this way, or if I have something strange going on with my portable app.

Any advice for granny?

Bug: multiple "cover-image" tags

$
0
0
I love the Add Cover... tool. Nice, responsive cover — what's not to like? But it's got a bug that I find irritating.

When you use it to replace a cover image, it adds the properties="cover-image" property to the new image in the OPF manifest... but doesn't remove it from the old one.

This leads to epubcheck failure, and having to go back and find the old image and remove the property in the OPF file manually. Not a huge problem, but annoying.

I'm running Sigil 0.9.8 on a MacBook Pro running macOS 10.12.6, FWIW.

Other folks have run into this, right? I often have to replace the cover before uploading to KDP, since I don't want the full-scale image taking up valuable KB; and sometimes, with series, I'm simply dropping the new text (and cover) into the template file.

Manual navigation bar Epub 2.0

$
0
0
What is the best method to include a manual navigation bar in a page header? What are the pros and cons of this? The book that I have in process in Sigil Epub 2.0 coding has many cross-references and in order to make navigation easier for the user, I would like to have a navigation bar at each section that goes directly to a summary Table of Contents, detail Table of Contents, the Index, and References. My development EPUB reader is Akido for Android. The code that I used to implement this is below, but I am wondering if there are better examples or opinions on adding this into a EPUB book, i.e. - duplication of features, other solutions, interference with a broader range of readers.

Navigation bar at start of page-sections -

<p class="navBar"><a href="../Text/TOC.xhtml">Seasons</a>&nbsp;&nbsp;
<a href="../Text/TOD.xhtml">Days</a>&nbsp;&nbsp;<a href="../Text/Index.xhtml">Index</a>&nbsp;&nbsp;<a href="../Text/References.xhtml">References</a></p>

CSS file entry -

.navBar{color: white; a:link{color:white}; a:visited{color:green}; background-color: aqua; font-size: 0.9em; text-align: left;}

Looking for a plugin

$
0
0
There was a plugin which looked for svg images and reset any incorrect image dimensions. Can anyone provide me link to that?? The original thread seems to be closed with no link. Please help.:help:
Viewing all 3441 articles
Browse latest View live


Latest Images