Description: | A command-line stream parser for beautifying CSS. |
Latest Version: | 2013 |
Source Code: | src/ |
Architecture: |
|
Build Dependencies: |
|
Arch Repositories: |
|
AUR Page: | beautify-css |
Arch Forum Thread: | 166537 |
Tags: |
This is a Parsec-based Haskell CSS parser that follows the W3C CSS3 module syntax draft. For now it simply parses CSS piped to STDIN and prints formatted CSS to STDOUT.
Comments are (currently) stripped from the CSS file because the draft’s grammar ignores them.
In addition to formatting whitespace and removing comments, selectors and declarations are also sorted.
This does not fix CSS errors. It will fail when it encounters them.1
Here’s a list of things that I will likely do when I have some time and motivation:
Note that I only wrote this as a fun2 little exercise to distract me for a bit from a larger Haskell project that I was working on, so don’t bother asking me why I didn’t use some existing application instead.
Remote CSS file:
curl 'https://bbs.archlinux.org/style/ArchLinux.css' | beautify-css
Local CSS file:
beautify-css < ArchLinux.css > ArchLinux.pretty.css
Compare the before and after versions in the examples directory.