Code and documentation for writing and reading CDF.
CoffeeScript JavaScript Mathematica HTML CSS Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Crisp Document Format


This repo contains all the code needed to read CDF documents. This includes a parser, which takes CDF documents and generates an HTML+JS equivalent document, client libraries, or javascript libraries that are intended to be part of the browsers trusted base and which implement client side functionality defined in a CDF document, and a HTTP proxy, which sits between the CDF-speaking server and the client, and allows commodity browsers to render CDF documents by translating them into HTML and javascript.

Each of these pieces are written in coffeescript, intended to be run in NodeJS. Grunt is used to manage building everything.


This software uses the standard node package manager system for installing and managing dependencies. Assuming you have node and npm installed, getting everything installed is as simple as running npm install in the root of this repo.


The code and resources in this repo are organized as follows:


Build script, using the Grunt build system. This is analogous to a Make file, though uses node to implement the build process. Build steps include compiling the coffeescript code into javascript, using compass to build the SASS implemented styles in some of the demos, and building HTML versions of the documentation from the original markdown versions.

This very file you're reading right now.


Very simple examples of CDF applications. They are not very useful, but are intended to give examples of both how larger applications could be structured, and demonstrate how each of three parts of the CDF system work together.


Reference documents, most importantly the reference definition of the CDF document format. Docs are written in markdown (from the docs/markdown subdirectory) and compiled into HTML (in the docs/html subdirectory).


GPL3 license, which covers all of the code in the /src sub-directory.


The NPM package definition for all the code and dependencies used in this project. For those unfamiliar with how to use this file, see the NPM reference documentation.


The source code used for the project. For each section, the original, commented coffeescript is included in the /src/<part>/coffee subdirectory, and the resulting, ready to run javascript in the /src/<part>/js subdirectory.


Implementation of a CDF to HTML parser. This code includes all code needed to read in a javascript object representation of either a complete CDF document, or a CDF update, and render back the needed HTML and javacript for rendering and / or interpreting in a browser.

This code can be used directly with the included parser command line too. You can use this with node src/parser/js/parser.js --in <input file>. You can use the --help flag to see other available options.


Implementation of an HTTP proxy. The proxy passes requests from the browser / client to the destination, and then either converts the server's CDF response into HTML and javascript to be rendered by the browser, or an error description if the server's response is invalid CDF or HTTP response. The only exception is if the client is requesting a library that CDF implements, in which case the proxy replies to the request itself.

The proxy is started by using the src/proxy/js/proxy.js script. This script accepts several arguments / flags, which are described with the --help flag.


Client side javascript libraries that implement the interactive elements of rendered HTML + JS documents. They are served automatically by the proxy.