Permalink
Browse files

Example for the plugin

  • Loading branch information...
1 parent 870141b commit a36b70e00c4a88567a8e0c6917318ab5c5cca583 @Panya Panya committed with slang800 Sep 15, 2012
Showing with 24 additions and 0 deletions.
  1. +4 −0 lib/nib.js
  2. +20 −0 lib/nodes/hello-world.js
View
@@ -27,6 +27,8 @@ try {
// ignore
}
+var hello = require('./nodes/hello-world')
+
/**
* Library version.
*/
@@ -64,5 +66,7 @@ function plugin() {
} else {
style.define('has-canvas', nodes.false);
}
+
+ style.define('hello-world', hello);
}
}
View
@@ -0,0 +1,20 @@
+
+/**
+ * Module dependencies.
+ */
+
+var stylus = require('stylus')
+ , nodes = stylus.nodes
+ , utils = stylus.utils
+
+/**
+ * Expose `hello`.
+ */
+
+module.exports = function(value) {
+ if (value) {
+ return 'Hello ' + value.toString().toUpperCase()
+ } else {
+ return 'Hello World'
+ }
+}

0 comments on commit a36b70e

Please sign in to comment.