![]() |
[Plugin] CSSLint - Simple CSSLint wrapper
1 Attachment(s)
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 csslintSigil: 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 {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) |
Added to the plugin index. Thanks!
|
| All times are GMT -4. The time now is 08:24 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.