03-23-2016, 05:06 PM | #1 |
Grand Sorcerer
Posts: 5,636
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
[Plugin] CSSLint - Simple CSSLint wrapper
Current Version: "0.2"
This plugin is a very simple CSSLint wrapper, which allows you to check all stylesheets in the currently loaded book with Sigil. Unfortunately, it does not work with OSX! Note that since CSSLint is executed in the background, you'll have to wait a couple of seconds before the messages are being displayed. Disclaimer: This is a beta version. Even though it's unlikely that it'll somehow corrupt the epub that you're working on or crash Sigil, you might want to save your ePub in Sigil before running this plugin. Since CSSLint wasn't optimized for ebooks, you also might want to check your stylesheets via Validate with W3C. System requirements If you're using an older Sigil version, you'll need to install a Python interpreter and select its path in the Manage Plugins dialog box. This plugin obviously also requires CSSLint. Installation CSSLint: 1. Install npm (Linux users might also need to install node.js.) 2. Enter the following command as an administrator in a terminal or Admin command prompt window: Code:
npm install -g csslint Sigil: 1. Select Manage Plugins from the Plugins menu. Then select Use Bundled Python. (If you haven't updated to the latest Sigil version click one of the Auto buttons to detect the path or click Set to manually select the Python interpreter path.) 2. Click Add Plugin and select CSSLint_v0.2.zip. This will install the CSSLint plugin, which you can select via Plugins > Validation > CSSLint. Known issues: 1. Calibre page_styles.css For some reason CSSLint can't handle the following default page_styles.css rule added by Calibre: Code:
@page { margin-bottom: 5pt; margin-top: 5pt } Alternatively, change the value of the following CSSLint.json entry to false: Code:
"shorthand": false,
CSSLint is rather picky and'll flag a couple of issues that are totally irrelevant for epubs. However, you can customize CSSLint via a CSSLint.json file that has the same format as the default .csslintrc file. a) Create a CSSLint folder in sigil-ebook/sigil/plugins_prefs (Edit > Preferences > Open Preferences Location) b) Create a CSSLint.json text file with the following contents and copy it to sigil-ebook/sigil/plugins_prefs/CSSLint/ Spoiler:
c) Disable unwanted rules by changing their values from true to false. (You can also delete unwanted entries, however, make sure that the last entry isn't terminated by a comma.) For example, my CSSLint.json file looks like this: Spoiler:
For more information on these rules and why the developers implemented them see the CSSLint Wiki. License: GNU General Public License v3 (GPL-3) Last edited by Doitsu; 08-15-2017 at 01:28 PM. Reason: Updated version for Sigil 0.9.7 attached |
03-23-2016, 06:51 PM | #2 |
Grand Sorcerer
Posts: 27,967
Karma: 198535232
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Added to the plugin index. Thanks!
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre annotations and highlight extract plugin for the Nook Simple Touch? | einkuser | Plugins | 15 | 01-24-2015 08:13 PM |
Install of simple plugin works on Linux and Win but not on OSX | kabirmaar | Development | 9 | 07-26-2014 07:49 PM |
Make a simple Plugin for Full Text Search using Recoll | Satas | Development | 9 | 07-20-2013 04:15 PM |
Adding an SVG Wrapper | ghostyjack | Sigil | 16 | 06-15-2013 05:13 AM |
An Issue about a SVG wrapper | RbnJrg | Kindle Formats | 29 | 06-10-2013 08:11 PM |