Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
mincss
Commits
d8a7e9a3
Commit
d8a7e9a3
authored
Aug 10, 2015
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated README and upgraded source to latest compiler version
parent
52324c62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
README.md
README.md
+18
-10
util.ml
util.ml
+3
-3
No files found.
README.md
View file @
d8a7e9a3
...
@@ -45,7 +45,8 @@ Generation of shorthand properties
...
@@ -45,7 +45,8 @@ Generation of shorthand properties
font-family: sans-serif; |
font-family: sans-serif; |
Any existing shorthands are first unfolded into their non-shorthand
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: normal 12px/15px sans-serif; | font: bold 12px/15px sans-serif;
font-weight: bold; |
font-weight: bold; |
...
@@ -72,7 +73,7 @@ Command-line interface
...
@@ -72,7 +73,7 @@ Command-line interface
======================
======================
Output of
`mincss -h`
:
Output of
`mincss -h`
:
Usage:
./
mincss [<options>] [<file> ...]
Usage: mincss [<options>] [<file> ...]
Generic options:
Generic options:
-h, --help Show this help message
-h, --help Show this help message
...
@@ -80,16 +81,16 @@ Output of `mincss -h`:
...
@@ -80,16 +81,16 @@ Output of `mincss -h`:
-o <file> Output file (defaults to stdout)
-o <file> Output file (defaults to stdout)
<file> ... Input files (default is to read from stdin)
<file> ... Input files (default is to read from stdin)
Optimization flags (
if none are specified, all are enable
d):
Optimization flags (
default is -w -c -s -
d):
-w, --whitespace Eliminate unnecessary whitespaces (has the greatest effect, omit for pretty-printing)
-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
-s, --shorthands Generate shorthand properties
-d, --duplicates Prune duplicate properties (WARNING: may affect cross-browser hacks)
-d, --duplicates Prune duplicate properties (WARNING: may affect cross-browser hacks)
-p, --pretty Shorthand for -c -s -d
-p, --pretty Shorthand for -c -s -d
-e, --echo Just parse and pretty-print, no optimizations
Formatting options:
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
Building mincss
...
@@ -100,15 +101,22 @@ Dependencies are [OCaml](https://ocaml.org/docs/install.html) 4.0 and
...
@@ -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:
Bootstrapping on a Debian system can be done as follows:
$ sudo apt-get install ocaml opam git
$ sudo apt-get install ocaml menhir git
$ opam init
$ opam switch 4.01.0
$ opam install menhir
$ git clone git@github.com:taddeus/mincss.git
$ git clone git@github.com:taddeus/mincss.git
$ cd mincss
$ cd mincss
$ make
$ make
$ ./mincss --help
$ ./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
TODO / bugs
===========
===========
...
...
util.ml
View file @
d8a7e9a3
...
@@ -20,7 +20,7 @@ let rec filter_none = function
...
@@ -20,7 +20,7 @@ let rec filter_none = function
let
input_all
ic
=
let
input_all
ic
=
let
n
=
in_channel_length
ic
in
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
;
really_input
ic
buf
0
n
;
close_in
ic
;
close_in
ic
;
buf
buf
...
@@ -32,11 +32,11 @@ let input_buffered ic chunksize =
...
@@ -32,11 +32,11 @@ let input_buffered ic chunksize =
|
nread
when
nread
=
bufsize
-
pos
->
|
nread
when
nread
=
bufsize
-
pos
->
let
bufsize
=
bufsize
+
chunksize
in
let
bufsize
=
bufsize
+
chunksize
in
let
pos
=
pos
+
nread
in
let
pos
=
pos
+
nread
in
read_all
(
buf
^
String
.
create
chunksize
)
bufsize
pos
read_all
(
buf
^
Bytes
.
create
chunksize
)
bufsize
pos
|
nread
->
|
nread
->
read_all
buf
bufsize
(
pos
+
nread
)
read_all
buf
bufsize
(
pos
+
nread
)
in
in
read_all
(
String
.
create
chunksize
)
chunksize
0
read_all
(
Bytes
.
create
chunksize
)
chunksize
0
(** Error printing *)
(** Error printing *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment