Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-03-2021, 03:59 PM   #1
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] CSSValidator - Offline W3C CSS Validator

Released: February 7, 2022
Current Version: "0.0.7"

This plugin allows you to validate CSS files with the offline version of the W3C CSS Validator.

Disclaimer: Even though it's unlikely that the plugin will somehow corrupt the epub that you're working on or crash Sigil, you may want to save your ePub or create a checkpoint before running this plugin.

Credits

BeckyEbook and RbnJrg tested earlier versions; BeckyEbook also created the plugin icon.

System requirements

This plugin requires Java and Sigil 0.9.8 or higher. If you uncheck the Use Bundled Python option, you'll also need to install Python 3.

To find out whether Java is installed, enter the following command in a terminal/command prompt window:
java -version (should display java version "1.8.0_xx" or a higher version number)

Installation

1. Select Manage Plugins from the Plugins menu and enable the Use Bundled Python option, if it isn't already enabled (or greyed out).
2. Click Add Plugin and select CSSValidator_v0.0.7.zip. This will install the plugin, which you can select via Plugins > Validation > CSSValidator.

Settings

Advanced users can change some CSS Validator settings by editing the following CSSValidator.json entries:

Code:
  "java_path": "java",
You can use this setting to define a custom Java path.

Code:
  "css_epub2_validation_spec": "css21",
  "css_epub3_validation_spec": "css3",
By default, the plugin will validate stylesheets in epub2 books against the CSS 2.1 specs and stylesheets in epub3 books against the CSS 3 specs.
If you want to validate them against different specs, simply change the default settings to one of the following values: css2, css21, css3 or css3svg. For example, you could use "css_epub3_validation_spec": "css3svg", to validate epub3 stylesheets against the CSS 3 + SVG specs.

Code:
  "ignore_message": [],
You can use this plugin setting to filter out certain errors and warnings via their ids. For example, you could use "ignore_message": ["vendor-extension"], to filter out warnings about vendor extensions, e.g. -webkit-hyphens: none;.

Code:
  "lang": "en"
By default, the plugin will select the Sigil GUI language as the default language for W3C CSS Validator error and warning messages, if the language is supported by the W3C CSS Validator. However, you can also change it to one of the following languages: "bg", "cs", "de", "el", "en", "es", "fa", "fr", "hi", "hu", "it", "ja", "ko", "nl", "pl", "pt", "ro", "ru", "sv", "uk", "zh".

(As with all JSON files, the last entry must not be terminated by a comma.)

To display the folder that contains CSSValidator.json select Edit > Preferences > Open Preferences Location. Then double-click plugins_prefs and CSSValidator.
Windows users can also press WIN+R, paste %localappdata%\sigil-ebook\sigil\plugins_prefs\CSSValidator into the Run dialog box and hit Enter.

Troubleshooting

If you're getting a Python error: an exception of type JSONDecodeError occurred. error message for all epub files, most likely Java isn't installed or the Java binary couldn't be found. (You can download Java from the Oracle website.)

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip CSSValidator_v0.0.7.zip (8.69 MB, 1299 views)

Last edited by Doitsu; 02-07-2022 at 04:00 PM.
Doitsu is offline   Reply With Quote
Old 10-03-2021, 04:13 PM   #2
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: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
Added to the Sigil Plugin Index. A great addition! Thank You!
KevinH is offline   Reply With Quote
Advert
Old 10-04-2021, 01:19 AM   #3
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS


I have been wishing for this for a long time
odamizu is offline   Reply With Quote
Old 10-04-2021, 10:53 AM   #4
Binchen
Connoisseur
Binchen began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Jul 2021
Device: Abakus
Quote:
Originally Posted by Doitsu View Post
If you're getting a Python error: an exception of type JSONDecodeError occurred. error message for all epub files, most likely Java isn't installed or the Java binary couldn't be found. (You can download Java from the Oracle website.)
What about OpenJDK?
Binchen is offline   Reply With Quote
Old 10-04-2021, 11:38 AM   #5
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: 28,045
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Binchen View Post
What about OpenJDK?
Theoretically, there's no reason it shouldn't work. As long as typing:
Code:
java -version
at a command prompt works as expected. I'll try to check when I get home.
DiapDealer is offline   Reply With Quote
Advert
Old 10-04-2021, 12:07 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Binchen View Post
What about OpenJDK?
OpenJDK worked on my Linux machine.
If my EpubCheck plugin works on your machine, this plugin should work, too.
Doitsu is offline   Reply With Quote
Old 10-05-2021, 08:58 AM   #7
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: 28,045
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Works fine with OpenJDK for me, as well.
DiapDealer is offline   Reply With Quote
Old 10-06-2021, 04:29 AM   #8
Binchen
Connoisseur
Binchen began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Jul 2021
Device: Abakus
Strangely both plugins do not run with Oracles JRE on my mac. On my Mac i have to use oracles JDK. On Windows the JRE is sufficient.
Since I work mainly on Mac I have now installed OpenJDK without getting problems with the plugins.
Binchen is offline   Reply With Quote
Old 10-06-2021, 11:53 AM   #9
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: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
This is a long time bug in the Oracle macOS JRE installer as it does *not* update the system paths properly. The Oracle JDK installer does do it properly. So I always install the JDK if I am using Oracle java on macOS.

Quote:
Originally Posted by Binchen View Post
Strangely both plugins do not run with Oracles JRE on my mac. On my Mac i have to use oracles JDK. On Windows the JRE is sufficient.
Since I work mainly on Mac I have now installed OpenJDK without getting problems with the plugins.
KevinH is offline   Reply With Quote
Old 05-20-2024, 06:21 AM   #10
mietek81
Connoisseur
mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!
 
Posts: 79
Karma: 5414
Join Date: Mar 2013
Location: CK, Poland
Device: Kobo Glo, H2O
I'm on Windows 11. For me 'java -version' works but plugin still gives error.
My java binary path is: D:\Programy\Java\bin\javaw.exe
If I try to change java_path in CSSValidator.json to above value then after using plugin in sigil the java_path returns to 'java' and still doesn't work.
What should I do?
mietek81 is offline   Reply With Quote
Old 05-20-2024, 06:49 AM   #11
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
The plugin works fine on my Windows 11 machine.
Here's the output from java -version.

Code:
java version "1.8.0_391"
Java(TM) SE Runtime Environment (build 1.8.0_391-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.391-b13, mixed mode)
As you can see, I'm still using Java 8.
Please post the complete error message from the Plugin Runner window.

BTW, if you want to specify the path on a Windows machine, you'll need to specify the path to java.exe not javaw.exe.

For example:

Code:
  "java_path": "C:\\Program Files\\Java\\jre-1.8\\bin\\java.exe",
or

Code:
  "java_path": "C:/Program Files/Java/jre-1.8/bin/java.exe",

Last edited by Doitsu; 05-20-2024 at 06:57 AM.
Doitsu is offline   Reply With Quote
Old 05-23-2024, 04:48 PM   #12
mietek81
Connoisseur
mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!mietek81 , Klaatu Barada Niktu!
 
Posts: 79
Karma: 5414
Join Date: Mar 2013
Location: CK, Poland
Device: Kobo Glo, H2O
Quote:
Originally Posted by Doitsu View Post

Code:
  "java_path": "C:\\Program Files\\Java\\jre-1.8\\bin\\java.exe",
or

Code:
  "java_path": "C:/Program Files/Java/jre-1.8/bin/java.exe",
Thank you, that helped
mietek81 is offline   Reply With Quote
Old 08-07-2024, 08:17 AM   #13
hayaku
Member
hayaku began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2023
Device: Kindle
Hello. Wonderful plugin

Quick question: Is this still being updated/supported?

Reason I ask is, it keeps throwing up errors when I use "rem" in my CSS.

IE, unit : “rem” is an incorrect unit : padding: 0.25rem; when I have a CSS entry like "padding: 0.25rem;".

As best as I can tell, rem is a totally valid CSS entry, and more to the point, is too damn useful to go without.

Can this be updated to allow rem?
hayaku is offline   Reply With Quote
Old 08-07-2024, 09:16 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: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
It is valid in css3, but epub2 is limited to css2 or css2.1
Is your epub an epub3 or epub2?
KevinH is offline   Reply With Quote
Old 08-07-2024, 09:57 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,529
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hayaku View Post
Hello. Wonderful plugin

Quick question: Is this still being updated/supported?

Reason I ask is, it keeps throwing up errors when I use "rem" in my CSS.

IE, unit : “rem” is an incorrect unit : padding: 0.25rem; when I have a CSS entry like "padding: 0.25rem;".

As best as I can tell, rem is a totally valid CSS entry, and more to the point, is too damn useful to go without.

Can this be updated to allow rem?
Why do you need rem when em works in all cases be it ePub 3 or ePub 2? rem is not actually needed. em does exactly the same thing in ePub 3 and works in ePub 2.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
W3C Validator JustinThought Sigil 2 08-21-2018 10:33 PM
Offline CSS Validator? odamizu ePub 9 04-13-2016 02:09 AM
validate with W3C Validator question Capricorn ePub 12 03-09-2016 04:25 PM
W3C css Validator problem? pete6055 Sigil 14 02-28-2013 10:19 AM


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


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