Permalink
Browse files

.use() docs

  • Loading branch information...
1 parent 11e37e4 commit de43ffe2d7c3e4cd1852f9cf3d6d817a433bddc5 @tj tj committed Apr 12, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 docs/js.md
View
15 docs/js.md
@@ -114,4 +114,17 @@ In our example we define four functions `add()`, `sub()`, `image-width()`, and `
For further reference until documentation is complete please reference the following files:
- lib/nodes/*
- - lib/utils.js
+ - lib/utils.js
+
+### .use(fn)
+
+ When called, the given `fn` is invoked with the renderer, allowing all of the methods above to be used. This allows for plugins to easily expose themselves, defining functions, paths etc.
+
+ var mylib = function(style){
+ style.define('add', add);
+ style.define('sub', sub);
+ };
+
+ stylus(str)
+ .use(mylib)
+ .render(...)

0 comments on commit de43ffe

Please sign in to comment.