File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
src/main/java/org/kohsuke/stapler/less Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
# On-the-fly LESS compiler
2
2
3
3
This library defines an object you can bound in the URL space (via Stapler) to compile LESS files
4
- from classpath and serve them as CSS files.
4
+ from classpath and serve them as CSS files. This enables modular web applications to compose
5
+ their LESS files at runtime to enable late binding.
6
+
7
+ To use it, expose ` LessServer ` from your URL space (for example by binding it to a field of your "App" class.)
8
+
9
+ ```
10
+ class App {
11
+ public final LessServer less_css = new LessServer();
12
+ }
13
+ ```
14
+
15
+ Then request to ` /less_css/foo/bar/zot.less.css ` would compile and render ` foo/bar/zot.less ` in your classpath.
16
+ To prevent leaking the class files and other potentially sensitive information inside the program, ` LessServer `
17
+ only serves ` *.less ` files.
5
18
6
- In this way, modular web applications can compose their LESS files at runtime to enable late binding.
7
19
8
20
This library relies on [ lesscss-java] ( https://github.com/marceloverdijk/lesscss-java ) , which in turn uses
9
21
Rhino to run the original version of the less compiler. lesscss-java is in many ways poorly implemented,
Original file line number Diff line number Diff line change 19
19
* @author Kohsuke Kawaguchi
20
20
*/
21
21
public class LessServer {
22
- private final ClassLoader cl ;
22
+ protected final ClassLoader cl ;
23
23
24
24
/**
25
25
* Directory to store the generated CSS as cache.
26
26
*/
27
- private final File cache ;
27
+ protected final File cache ;
28
28
29
29
/**
30
30
* Cache file we generate should have this timestamp, or else we need to regenerate the file.
You can’t perform that action at this time.
0 commit comments