Commit d8a7e9a3 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Updated README and upgraded source to latest compiler version

parent 52324c62
......@@ -45,7 +45,8 @@ Generation of shorthand properties
font-family: sans-serif; |
Any existing shorthands are first unfolded into their non-shorthand
counterparts, after which the last value is used for shorthand generation:
counterparts to be folded back later. This means that if `--duplicates` is
enabled, the last value is used for shorthand generation, merging separate :
font: normal 12px/15px sans-serif; | font: bold 12px/15px sans-serif;
font-weight: bold; |
......@@ -72,7 +73,7 @@ Command-line interface
======================
Output of `mincss -h`:
Usage: ./mincss [<options>] [<file> ...]
Usage: mincss [<options>] [<file> ...]
Generic options:
-h, --help Show this help message
......@@ -80,16 +81,16 @@ Output of `mincss -h`:
-o <file> Output file (defaults to stdout)
<file> ... Input files (default is to read from stdin)
Optimization flags (if none are specified, all are enabled):
Optimization flags (default is -w -c -s -d):
-w, --whitespace Eliminate unnecessary whitespaces (has the greatest effect, omit for pretty-printing)
-c, --simple Shorten colors and font weights
-c, --simple Shorten colors, font weights and nth-child
-s, --shorthands Generate shorthand properties
-d, --duplicates Prune duplicate properties (WARNING: may affect cross-browser hacks)
-p, --pretty Shorthand for -c -s -d
-e, --echo Just parse and pretty-print, no optimizations
Formatting options:
--sort Sort declarations in each selector group
-r, --sort Sort declarations in each ruleset (always on when --shorthands is enabled)
-e, --echo Just parse and pretty-print, no optimizations
Building mincss
......@@ -100,15 +101,22 @@ Dependencies are [OCaml](https://ocaml.org/docs/install.html) 4.0 and
Bootstrapping on a Debian system can be done as follows:
$ sudo apt-get install ocaml opam git
$ opam init
$ opam switch 4.01.0
$ opam install menhir
$ sudo apt-get install ocaml menhir git
$ git clone git@github.com:taddeus/mincss.git
$ cd mincss
$ make
$ ./mincss --help
I prefer to use [Opam](https://opam.ocaml.org/) myself because it offers more
flexibility:
$ sudo apt-get install opam
$ opam init
$ eval `opam config env`
$ opam switch 4.02.0
$ opam update
$ opam install menhir
TODO / bugs
===========
......
......@@ -20,7 +20,7 @@ let rec filter_none = function
let input_all ic =
let n = in_channel_length ic in
let buf = String.create n in
let buf = Bytes.create n in
really_input ic buf 0 n;
close_in ic;
buf
......@@ -32,11 +32,11 @@ let input_buffered ic chunksize =
| nread when nread = bufsize - pos ->
let bufsize = bufsize + chunksize in
let pos = pos + nread in
read_all (buf ^ String.create chunksize) bufsize pos
read_all (buf ^ Bytes.create chunksize) bufsize pos
| nread ->
read_all buf bufsize (pos + nread)
in
read_all (String.create chunksize) chunksize 0
read_all (Bytes.create chunksize) chunksize 0
(** Error printing *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment