Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mincss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
mincss
Commits
d8a7e9a3
Commit
d8a7e9a3
authored
9 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Updated README and upgraded source to latest compiler version
parent
52324c62
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+18
-10
18 additions, 10 deletions
README.md
util.ml
+3
-3
3 additions, 3 deletions
util.ml
with
21 additions
and
13 deletions
README.md
+
18
−
10
View file @
d8a7e9a3
...
...
@@ -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 enable
d):
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
===========
...
...
This diff is collapsed.
Click to expand it.
util.ml
+
3
−
3
View file @
d8a7e9a3
...
...
@@ -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 *)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment