MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Sigil: CSS problem (https://www.mobileread.com/forums/showthread.php?t=342169)

FrankJH 10-06-2021 06:14 AM

Sigil: CSS problem
 
Dear all,

I'm relatively new to ebook creation, so I hope it's ok if I ask this question here ... I did a lot of google research in the last days, but have not found any useful solutions so far ...

Recently, I updated my operating system from SuSe Leap 15.1 to 15.2, then to SuSe Leap 15.3 - there is Sigil 1.2.1 now.

When I open my ebook, the preview doesn't apply my stylesheet settings any more.

Furthermore, it seems as if the stylesheet I use in this ebook is completely ignored.

What's curious: in my recent version on SuSe Leap 15.1, all worked fine.

I read in this forum that there were similar problems with the newest version sometimes .. but 1.2.1 is not the newest version, it is 1.7.0 in the meantime ...

Any ideas how I can get my stylesheet work again?

Kind regard, and thanks a lot for your efforts, Frank

Turtle91 10-06-2021 06:24 AM

Welcome to MR!!

There are a few reasons this could be happening. Taking the risk of sounding like an IT troubleshooting rep, and not intending to imply anything bad: The first step is ensuring you have the CSS stylesheet linked to the html document properly.

- right click on the html document(s) and select link stylesheet
- select the stylesheet(s) you wish to link


Sometimes Sigil will expect to find resources (CSS, Images, Fonts) in a location that differs from the actual ePub - or from where the link says they are located. Using the above steps fixes most of that. The next step - which I use most of the time - is to reorganize those resources into a standard file structure by selecting that from the tools menu.

If that doesn't work, then let us know and we can start looking at some other options.

Cheers!

FrankJH 10-06-2021 06:51 AM

Thanks for your fast reply, and for your "Welcome" too :thanks:

I read about similar problems here, and that

>> - right click on the html document(s) and select link stylesheet

was what I tried ... without any effect.

>> The next step - which I use most of the time - is to reorganize those resources into a standard file

You mean "Tools -> Restructure Epub to Sigil norm"?

That's what I tried too ... without any effect.

I read here in the forum that similar things happened to some people who updated their Sigil version ... my previous version must have been 0.9.x or so, and the stylesheet was working in the preview ...

Some people wrote about some changes in the epub structure since Sigil 1.x or so ... it must have to do with this, but I have no idea how to solve this ...

Best wishes, Frank

DiapDealer 10-06-2021 07:42 AM

If you updated from Sigil 0.9.x to Sigil 1.2.1, there's a few new python modules that are mandatory for Sigil to function properly. One of those modules is the css-parser module. Unfortunately, not all Linux distros are great at picking up on these python requirement changes. It's been a while since I've used SuSe, so I don't know the particulars of installing python modules from Suse repos, but the package should be called something like python-css-parser

The dulwich module also became mandatory (for Sigil's checkpointing feature), so you may want to make sire that's installed as well. Unfortunately, it looks like the version in the SuSe 15.3 repos is quite old (0.18.x). You'll probably want to use pip install to get a version 0.19 or newer.

If that's not the issue, then we'll probably need to see some actual epub samples to see what's going on. Just remember not to attach any copyrighted epubs if you decide to go that route.

FrankJH 10-06-2021 09:48 AM

1 Attachment(s)
Thanks for your offer.

Maybe sometimes it's not the best idea to update an existing system ... I'm not so familar with updating python modules, maybe the problem is located elsewhere, maybe my mistake ... otherwise I have to consider a complete new installation of the software ...

To see the problem, I created a simple new epub called "sample.epub".

I use my original stylesheet and linked it ... a span class "bluebold" (see below) is defined in the styleheet, but the formatting

span.bluebold {
color: #0066cc;
font-weight: bold;
}

won't appear in the preview - any idea what could be the cause?

Best wishes, Frank

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title></title>
<link href="../Styles/sgc-nav.css" type="text/css" rel="stylesheet"/>
</head>

<body>
<p>saasa</p>
<span class="bluebold">Some Text</span>
</body>
</html>

DiapDealer 10-06-2021 10:11 AM

There's a syntax error in your css file at line 208, but that shouldn't make Preview ignore the entire css file (but any ADE-based rendering engines probably will). It doesn't with the latest version of Sigil on Windows or Linux, anyway.

span.boldspan. shouldn't have the period at the end.

Quote:

Originally Posted by FrankJH (Post 4160281)
I read in this forum that there were similar problems with the newest version sometimes .. but 1.2.1 is not the newest version, it is 1.7.0 in the meantime ...

I'm unaware of any issues with the newest version of Sigil properly displaying css. Can you point to some of the threads/posts you found in the forum that suggested otherwise? Maybe something there will shed some light on the problem.

KevinH 10-06-2021 10:44 AM

FWIW, I did see this in the Bugs Fixed for Sigil-1.3.0,

- Fix bug that prevented css updates from being shown in Preview without reload

Not sure if that old bug is the culprit or not.

Sigil 1.2.1 is a very old version of Sigil.

DiapDealer 10-06-2021 10:48 AM

I got the impression that the OP was opening existing epubs that worked with older versions of Sigil/OS. If that's not the case, simply saving the epub and re-opening it should determine if that bug is the culprit, no?

KevinH 10-06-2021 10:58 AM

Yes. Correct. That old bug was from editing changes in css tab not showing up in Preview until that page that used it was reloaded.

DiapDealer 10-06-2021 11:27 AM

Well it looks like openSUSE Leap 15.3 DOES install all of the necessary python dependencies, so it's not that. Still finishing up getting a VM set up to test their repo version of Sigil-1.2.1.

KevinH 10-06-2021 11:47 AM

I have tested the sample.epub (after fixing the extra . typo in the css stylesheet) on macOSX with Sigil 1.7, 1.6, 1.5.1, 1.4.3, 1.30, and 1.2.0 (1.2.1 was a linux only source release) and it always shows the text on opening in blue bold.

So whatever the issue is, it is Linux specific and maybe even SuSE specific. My quess is it is QtWebEngine related.

If it worked on SuSE Leap 15.1, what version of Sigil was that? Could this be related to the move from QtWebKit to QtWebEngine after Sigil-0.9.14?

Turtle91 10-06-2021 12:16 PM

Quote:

Originally Posted by FrankJH (Post 4160344)
Thanks for your offer.

Maybe sometimes it's not the best idea to update an existing system ... I'm not so familar with updating python modules, maybe the problem is located elsewhere, maybe my mistake ... otherwise I have to consider a complete new installation of the software ...

To see the problem, I created a simple new epub called "sample.epub".

I use my original stylesheet and linked it ... a span class "bluebold" (see below) is defined in the styleheet, but the formatting

span.bluebold {
color: #0066cc;
font-weight: bold;
}

won't appear in the preview - any idea what could be the cause?

Best wishes, Frank

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title></title>
<link href="../Styles/sgc-nav.css" type="text/css" rel="stylesheet"/>
</head>

<body>
<p>saasa</p>
<span class="bluebold">Some Text</span>
</body>
</html>

I'm not saying this is the cause of your problem, but just something I noticed.

Usually a span will be inside a block element:

Code:

<p><span class="bluebold">Some Text</span></p>
edit:
It does work...just not normal... and I understand it is just a sample. :D
Regardless - it also previews properly on my windows10 x64

KevinH 10-06-2021 12:20 PM

Based on a quick websearch OpenSuSE Leap 15.1 used a very old Sigil 0.9.10.

The OP may want that older version if they need to use BookView style editing.

FrankJH 10-06-2021 12:32 PM

Yes, the "." in my css was not correct ...

I can't remember my Sigil version on 15.1 ... but it must be related to Qt ...

My idea was to install a newer version of SIgil, so I downloaded 1.4.3 and 1.7.0 ...

As described, I executed

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../Sigil-1.7.0

and received the errors below in both cases:


CMake Error at src/CMakeLists.txt:800 (add_executable):
Target "sigil" links to target "Qt5::PrintSupport" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:800 (add_executable):
Target "sigil" links to target "Qt5::WebEngine" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:800 (add_executable):
Target "sigil" links to target "Qt5::WebEngineWidgets" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:800 (add_executable):
Target "sigil" links to target "Qt5::Network" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?


CMake Error at src/CMakeLists.txt:800 (add_executable):
Target "sigil" links to target "Qt5::Concurrent" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?

DiapDealer 10-06-2021 12:34 PM

Well I set up an openSUSE VM and I can confirm that all css is being flat-ass ignored using their repo version of Sigil 1.2.1! We obviously can't go back in time and fix the 1.2.1 version of Sigil, but when I get some time, I'll see if I can figure out why it's happening, and if there might be some kind of workaround for it.

I saw at least one Qt 5.12.x version flying by, so it shouldn't be an issue of too old a Qt/QtWebEngine.

DiapDealer 10-06-2021 01:03 PM

You'll have to make sure all of the necessary dev-related Qt packages are installed if you want to build a newer version of Sigil yourself. The 'docs' folder of the source tree has some pretty detailed descriptions of what needs to be installed to build.

DiapDealer 10-06-2021 01:23 PM

@KevinH: There was no UrlInterceptor stuff in 1.2.1 was there? That was my first thought when all css wasn't working, but I was thinking 1.3.0 was the first release for that.

@FrankJH: before you take the time to build Sigil yourself, I see that Sigil 1.7.0 is available via the openSUSE Community repositories. You might want to try that first.

KevinH 10-06-2021 01:27 PM

Checked Sigil-1.2.1 tag on github and no URLInterceptor code existed yet.
So it can't be that.

And as you said

https://software.opensuse.org/downlo...&package=sigil

Shows Sigil-1.7.0 is available at least for Tumbleweed and Sigil 1.3 for Leap 15.2.

DiapDealer 10-06-2021 01:35 PM

Leap 15.3 is not on that site yet. And although openSUSE Tumbleweed has Sigil 1.7.0, the Leap distros all only provide Sigil 1.2.1 (inherently). You have to enable a communities repository to get Sigil 1.7.0 on openSUSE Leap 15.2/3.

I don't know all the particulars, but I'll try it out when I get back home to my dev machine.

FrankJH 10-06-2021 02:22 PM

Sigil 1.7.0 is only available for Tumbletweed, but I was able to install Sigil 1.3.0 ... and wow, my formatings reappeared.

Thank you so much for your efforts! :thanks:

DiapDealer 10-06-2021 02:45 PM

Quote:

Originally Posted by FrankJH (Post 4160445)
Sigil 1.7.0 is only available for Tumbletweed, but I was able to install Sigil 1.3.0 ... and wow, my formatings reappeared.

Thank you so much for your efforts! :thanks:

1.7.0 is available (from community repos) for Leap 15.2, and I imagine it's only a matter of time for it to be available for 15.3 from the same community repo. It's already building, but packaging for 15.3 doesn't seem to be there quite yet.

You're right that Tumbleweed is the only one that comes pre-packaged with Sigil 1.7.0, but it can be installed from community packages on the others, as well.

DiapDealer 10-06-2021 03:32 PM

How did you manage install 1.3.0? Is there a backports or testing repository you used?

FrankJH 10-07-2021 05:26 AM

Quote:

Originally Posted by DiapDealer (Post 4160468)
How did you manage install 1.3.0? Is there a backports or testing repository you used?

Was really eager to use Sigil ... so I simply downloaded the rpm from

https://software.opensuse.org/downlo...&package=sigil

and installed the software via YAST ... although the 1.3.0-package belongs to 15.2, it worked out of the box :2thumbsup

Kind regards, Frank


All times are GMT -4. The time now is 09:22 PM.

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