Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-minify-css Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:32:37 2020 GMT+0.
• Introduction | What cl-minify-css is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
* cl-minify-css *** _To minify css with common lisp._ ** Getting Started in cl-minify-css *** Dependencies No dependencies. Yes, I was crazy, and I did it without cl-ppcre by fun. *** Download and Load *1 - Load cl-minify-css system by quicklisp* IN PROGRESS... but will be like this: ~(ql:quickload :cl-minify-css)~ *2 - Download and load cl-minify-css system by github and asdf* download from github: #+BEGIN_SRC git clone https://github.com/noloop/cl-minify-css.git #+END_SRC and load by asdf: #+BEGIN_SRC lisp (asdf:load-system :cl-minify-css) #+END_SRC *Note: Remember to configure asdf to find your directory where you downloaded the libraries (asdf call them "systems") above, if you do not know how to make a read at: https://common-lisp.net/project/asdf/asdf/Configuring-ASDF-to-find-your-systems.html or https://lisp-lang.org/learn/writing-libraries.* ** How to minify a css string? #+BEGIN_SRC lisp (defparameter css "/*By somebody | License GPLv3*/ div,ul,li:focus { outline:none; /*some comment*/ margin: 5px 0 0 1px; } body { font: 1em/150% Helvetica, Arial, sans-serif; padding: 1em; margin: 0 auto; max-width: 33em; } @media (min-width: 70em) { body { font-size: 130%; /*more some comment*/ } } h1 { font-size: 1.5em; }") (minify-css css :keep-license-p nil) ;; => "div,ul,li:focus{outline:none;margin:5px 0 0 1px;}body{font:1em/150% Helvetica, Arial, sans-serif;padding:1em;margin:0 auto;max-width:33em;}@media (min-width:70em){body{font-size:130%;}}h1{font-size:1.5em;}" (minify-css css :keep-license-p t) ;; => "/*By somebody | License GPLv3*/div,ul,li:focus{outline:none;margin:5px 0 0 1px;}body{font:1em/150% Helvetica, Arial, sans-serif;padding:1em;margin:0 auto;max-width:33em;}@media (min-width:70em){body{font-size:130%;}}h1{font-size:1.5em;}" #+END_SRC ** API function *(minify-css css &key keep-license-p)*
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-minify-css system |
noloop <noloop@zoho.com>
noloop <noloop@zoho.com>
(:git "git@github.com:noloop/cl-minify-css.git")
GPLv3
To minify css with common lisp.
1.0.0
cl-minify-css.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The cl-minify-css/src module |
cl-minify-css (system)
src/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-minify-css.asd file | ||
• The cl-minify-css/src/package.lisp file | ||
• The cl-minify-css/src/cl-minify-css.lisp file |
Next: The cl-minify-css/src/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-minify-css.asd
cl-minify-css (system)
Next: The cl-minify-css/src/cl-minify-css․lisp file, Previous: The cl-minify-css․asd file, Up: Lisp files [Contents][Index]
src (module)
src/package.lisp
Previous: The cl-minify-css/src/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/cl-minify-css.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The noloop.cl-minify-css package |
package.lisp (file)
cl-minify-css
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions |
Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
It returns a string without spaces, newlines and tabs for a given css class name. Example:
(class-name-without-spaces "div p,
div p + p, h1,
#myid ") => "div p,div p+p,h1,#myid"
cl-minify-css.lisp (file)
It returns the closing bracket index (here called end-bracket) of a given onpening bracket index (here called start-bracket) of one string (here called css).
cl-minify-css.lisp (file)
It returns a string for given char list. Example: (make-string-from-chars ’(#s #o #m #e)) => "some"
cl-minify-css.lisp (file)
It minify a css code removing spaces, newlines, tabs, comments. If want keep the license comment use :keep-license-p t.
cl-minify-css.lisp (file)
It returns the minified class string for a given css class string. If :keep-license-p t the comments that have "license" (non-case-sensitive) are kept. Example:
(minify-css ".myclass { margin: .67em 0; /* some comment */
padding: 5px; } ") => ".myclass{margin:.67em 0;padding:5px;}"
cl-minify-css.lisp (file)
It returns a string without spaces, newlines and tabs in the properties for given css. Example:
(properties-without-spaces "margin: .67em 0;
padding: 5px; ") => "margin:.67em 0;padding:5px;"
cl-minify-css.lisp (file)
It removes all comments of the css code, if :keep-license-p t the comments that have "license" (non-case-sensitive) are kept. Use :start-search <number> to remove the comments only after a start position string.
cl-minify-css.lisp (file)
It returns a string without all spaces, newlines and tabs for given string. Example: (remove-spaces-newlines-tabs " hi, I’m here! ") => "hi,I’mhere!"
cl-minify-css.lisp (file)
It returns a list with splited classes strings of a given css string. If the css has media-queries instead of a string is returned a list where the first is the media query, and the rest is the string classes. Example:
(split-css-in-classes "body{color:red;}@media (min-width:30em){body{color:green;}div{font-size:1em;}}")
=> ("body{color:red;}"
("@media (min-width:30em)"
("body{color:green;}"
"div{font-size:1em;}")))
cl-minify-css.lisp (file)
It returns a string without all spaces, newlines and tabs in its extremes, this functions doesn’t make nothing about the middle of the string. Example: (string-trim " hi, I’m here! ") => "hi, I’m here!"
cl-minify-css.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | C E F M P R S T |
---|
Jump to: | C E F M P R S T |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C N P S |
---|
Jump to: | C N P S |
---|