I did a little project with requirebin and vue. If you haven’t heard of requirebin, it’s a lot like jsfiddle or jsbin except it only has one file, which is JavaScript. I love the simplicity of it.

The recommended way to include CSS and HTML in requirebin is to use the insert-css and domify packages on npm. The multiline strings containing html and JavaScript can be hard to read in JavaScript so a solution is to use a DSL. I quickly wrote my own for CSS rulesets, and this time I just used JavaScript’s multiline syntax for the HTML.

I’d love to see some better tools for generating CSS and HTML with plain old JavaScript.

This month my goal is to post a small JavaScript project every day of the month. Today’s project is an angular.js app for jumping between paragraphs using the keyboard. Besides navigating between paragraphs it can show paragraphs before or after the current paragraph without leaving the page. This could help if the reader needs to recall a detail from the last paragraph in order to fully understand the current paragraph.

I used these resources to help me get it done:

  • How to listen for key presses with AngularJS – showed me that I wanted was keydown events on the body tag using ng-keydown
  • 5apps – a lot like GitHub pages with Jekyll turned off, except I don’t need to create another branch. Unlike Heroku, free apps don’t go to sleep.