Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Example for the plugin

  • Loading branch information...
commit a36b70e00c4a88567a8e0c6917318ab5c5cca583 1 parent 870141b
@Panya Panya authored slang800 committed
Showing with 24 additions and 0 deletions.
  1. +4 −0 lib/nib.js
  2. +20 −0 lib/nodes/hello-world.js
View
4 lib/nib.js
@@ -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
20 lib/nodes/hello-world.js
@@ -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'
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.