Permalink
Browse files

Wrote readme, made package.json

  • Loading branch information...
1 parent 0337b50 commit bfbdf06440227a17342a829626172a809b0eb4e9 @olalonde committed Nov 16, 2012
Showing with 60 additions and 0 deletions.
  1. +40 −0 README.md
  2. +20 −0 package.json
View
@@ -0,0 +1,40 @@
+# Install
+
+ npm install handlebars-paginate
+
+# Usage
+
+hbs.js
+
+```javascript
+/* ... */
+
+var paginate = require('handlebars-paginate');
+
+Handlebars.registerHelper('paginate', paginate);
+
+/* ... */
+
+var html = template({pagination: {
+ page: 3,
+ pageCount: 10
+}});
+```
+
+template.hbs
+
+```handlebars
+<div class="pagination pagination-centered">
+ <ul>
+ {{#paginate pagination type="previous"}}
+ <li {{#if disabled}}class="disabled"{{/if}}><a href="?p={{n}}" >Prev</a></li>
+ {{/paginate}}
+ {{#paginate pagination type="middle" limit="7"}}
+ <li {{#if active}}class="active"{{/if}}><a href="?p={{n}}">{{n}}</a></li>
+ {{/paginate}}
+ {{#paginate pagination type="next"}}
+ <li {{#if disabled}}class="disabled"{{/if}}><a href="?p={{n}}">Next</a></li>
+ {{/paginate}}
+ </ul>
+</div>
+```
View
@@ -0,0 +1,20 @@
+{
+ "name": "handlebars-paginate",
+ "version": "0.0.1",
+ "description": "Handlebars helper for pagination.",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/olalonde/handlebars-paginate.git"
+ },
+ "keywords": [
+ "handlebars",
+ "pagination",
+ "paginate"
+ ],
+ "author": "Olivier Lalonde <olalonde@gmail.com>",
+ "license": "BSD"
+}

0 comments on commit bfbdf06

Please sign in to comment.