diff --git a/README b/README deleted file mode 100644 index 60e04c5..0000000 --- a/README +++ /dev/null @@ -1,110 +0,0 @@ -What is LessCSS4j? ------------------- - -LessCSS4j is a java implementation of the LESS language (http://lesscss.org). -This version has all of the features of the original plus a few additional -features: - -* Support for Internet Explorer CSS oddities without the need for escaping -* Pluggable architecture to allow additional functions and transformations - to be provided. -* Optional Spring integration -* Optional Servlet API integration - -History -------- - -The original implementation of Less was written in Ruby. This turned out to to -run much too slowly for our purposes when run using JRuby. To solve this -problem, LessCSS4j was written. - -While Less has since been reimplemented (less.js) in JavaScript and performs -much better (Using NodeJS), there is still is a need for a Java version to ease -the integration with existing web frameworks. - - -Licensing ---------- - -See LICENSE.txt for more information - - -Command Line Usage ------------------- - -$ jlessc.sh myfile.less - -This will produce the file "myfile.css" in the same directory as "myfile.less". - -An optional output filename may be provided. If the output filename is '-', the -output is written to standard out. - -Use the '--help' or '-h' option for all of the options accepted. - - -Servlet Usage -------------- - -LessCSS4j provides a servlet to perform runtime compilation of LESS files. To -use it, add the following servlet to your web.xml file (shown with the default -init parameter values): - - - LessCssServlet - org.lesscss4j.servlet.LessCssServlet - - - cacheMilliseconds - -1 - - - - httpCacheMilliseconds - 900000 - - - - prettyPrint - false - - - - - LessCssServlet - /less/* - - -With this configuration, a request for the url /less/path/to/file.less will -look for the file /path/to/file.less in the servlet context, compile it using -the LessCSS4j compiler and return the resulting CSS. In addition, the result -is optionally cached to avoid recompilation. - -Embedded Compiler Usage ------------------------ - -The easiest way to embed the LessCSS compiler is shown in the following code -snippet: - -StyleSheetResource resource = new FileStyleSheetResource(filename); -LessCssCompiler compiler = new DefaultLessCssCompilerFactory().create(); -compiler.compile(resource, System.out, null); - - -Spring Integration ------------------- - -To embed the LessCSS compiler using the Spring Framework, several classes have -been provided in the org.localmatters.lesscss4j.spring package: - -LessCssCompilerFactoryBean - FactoryBean implementation derived from DefaultLessCssCompilerFactory that - allows the compiler to be configured via standard Spring XML wiring. - -SpringStyleSheetResourceLoader -SpringStyleSheetResource - Adapter classes that wrap Spring ResourceLoader and Resource - implementations, respectively. - diff --git a/README.md b/README.md new file mode 100644 index 0000000..2928ab9 --- /dev/null +++ b/README.md @@ -0,0 +1,114 @@ +What is LessCSS4j? +------------------ + +LessCSS4j is a java implementation of the LESS language (http://lesscss.org). +This version has all of the features of the original plus a few additional +features: + +* Support for Internet Explorer CSS oddities without the need for escaping +* Pluggable architecture to allow additional functions and transformations + to be provided. +* Optional Spring integration +* Optional Servlet API integration + +History +------- + +The original implementation of Less was written in Ruby. This turned out to to +run much too slowly for our purposes when run using JRuby. To solve this +problem, LessCSS4j was written. + +While Less has since been reimplemented (less.js) in JavaScript and performs +much better (Using NodeJS), there is still is a need for a Java version to ease +the integration with existing web frameworks. + + +Licensing +--------- + +See LICENSE for more information + + +Command Line Usage +------------------ + +LESS files can be compiled on the command line using the following: + + $ jlessc.sh myfile.less + +This will produce the file `myfile.css` in the same directory as `myfile.less`. + +An optional output filename may be provided. If the output filename is `-`, the +output is written to standard out. + +Use the `--help` or `-h` option for all of the options accepted. + + +Servlet Usage +------------- + +LessCSS4j provides a servlet to perform runtime compilation of LESS files. To +use it, add the following servlet to your `web.xml` file (shown with the default +init parameter values): + + + LessCssServlet + org.lesscss4j.servlet.LessCssServlet + + + cacheMilliseconds + -1 + + + + httpCacheMilliseconds + 900000 + + + + prettyPrint + false + + + + + LessCssServlet + /less/* + + +With this configuration, a request for the url `/less/path/to/file.less` will +look for the file `/path/to/file.less` in the servlet context, compile it using +the LessCSS4j compiler and return the resulting CSS. In addition, the result +is optionally cached to avoid recompilation. + +Embedded Compiler Usage +----------------------- + +The easiest way to embed the LessCSS compiler is shown in the following code +snippet: + + StyleSheetResource resource = new FileStyleSheetResource(filename); + LessCssCompiler compiler = new DefaultLessCssCompilerFactory().create(); + compiler.compile(resource, System.out, null); + + +Spring Integration +------------------ + +To embed the LessCSS compiler using the Spring Framework, several classes have +been provided in the org.localmatters.lesscss4j.spring package: + +* `LessCssCompilerFactoryBean` + + FactoryBean implementation derived from DefaultLessCssCompilerFactory that + allows the compiler to be configured via standard Spring XML wiring. + +* `SpringStyleSheetResourceLoader` +* `SpringStyleSheetResource` + + Adapter classes that wrap Spring ResourceLoader and Resource + implementations, respectively. +