Update: Springboard has recently undergone a complete rewrite. It’s now now much more powerful, flexible and Python (therefore cool). Checkout the Springboard GitHub page for more info.
It also means that this post is now largely irrelevant, so don’t trust it – trust the README.
I love HTML5 Boilerplate and use it a lot as a basis for web projects. Sometimes however, I find it still does a little bit too much for my needs and I end up removing a lot before I can get started.
So What’s Springboard Then?
It features a very useful ANT build file which, among other things, can:
- Refactor template files to match your project’s namespace so you’re ready to code in seconds
- Minify CSS using the YUI Compressor
- Sanitize HTML and inject variables at compile time
Hopefully No fluff – just the very basics you need to get a project or experiment started.
To get started, first clone the repository:
cd /your/workspace git clone firstname.lastname@example.org:soulwire/Springboard.git YourProjectName
Run the setup task and enter your project’s namespace when prompted:
cd YourProjectName ant setup Enter the full project namespace for this project: com.domain.project
This will refactor the project template to match your namespace. You’ll then be given the option to delete the GIT metadata and disconnect from the Springboard repository…
You can build your project with the default ANT task, build
And when you’re ready, generate documentation using the jsdoc task
You should also have a look at the build.properties file as here you can add your credentials and tweak the various build settings to your taste.
A Quick Note About Blocks
Springbard uses HTML comment blocks to figure out how it should build the project. There are different types of blocks you can use:
- CSS:LIB » Third party CSS files (combined and minified)
- CSS:SRC » Your project’s styles (combined and minified)
Springboard will look at all of your pages when it builds and combine all files in all blocks of the same type. There is then a generic document ready handler, which initialises scripts for a page based on the id tag of it’s body. This is best illustrated in this example.
A Quick Note About Externs
If you’ve used the Closure Compiler before, you’ll be familiar with Externs. Externs tell the compiler not to refactor certain methods and properties, because doing so may break your code if they reference a third party library or code not being compiled. Springboard currently ships with an externs file supporting JQuery 1.5, just to get you going. You can easily generate more for your favorite libraries using this great tool by Laurentiu Macovei or others like it.
What Springboard Doesn’t Do
So to be clear, it is in no way intended as a replacement for the amazing projects out there such as HTML5 Boilerplate; simply an option if you need less rather than more in certain situations.
Now fork off and start making nice things…