Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Hackasaurus hack jam how-to

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 fonts
Octocat-spinner-32 images
Octocat-spinner-32 stylesheets
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 jquery.min.js
Octocat-spinner-32 kit.html
Octocat-spinner-32 package.json
Octocat-spinner-32 vandegraaff.js
README.md

This is the content for the hackasaurus.org hacktivity kit.

Prerequisites

Conversion toolchain

Prince does not offer as full-featured support for JavaScript as modern browsers do. To allow the use of libraries like jQuery (which Prince currently cannot handle) the files get "compiled" into static HTML before feeding them to Prince.

jsdom

vandegraaff.js is a node.js script that uses jsdom to load the page, allow any initial JavaScript to run, and dump a static HTML version out. This gets sent to...

Prince

You need Prince 8.0 to generate the PDF version of the kit. The free version is fine.

Sample command

cat kit.html | node vandegraaff.js | prince -s stylesheets/print.css -o kit.pdf -

This creates kit.pdf that you can open with your favorite PDF viewer.

With -v, Prince may report errors like:

prince: kit.html:9: error: Tag section invalid<

These don't affect processing and should disappear with upcoming releases of Prince.

Testing

Ideally, all tests should be viewed in both a browser and converted to PDF to ensure compatability in both scenarios. The strategy above should work for QUnit pages, which can be compiled to static HTML and viewed in a browser for pass/fail status.

Something went wrong with that request. Please try again.