# TimelineSetter <%= version %>
TimelineSetter creates beautiful timelines.
It is a command-line utility that takes a [specially-structured CSV file](#csv)
as input and outputs standards-compliant HTML/CSS/JavaScript. It supports any
span of time from minutes to years, and supports multiple parallel event
series in a single timeline. It can handle custom descriptions and even
arbitrary HTML in each event "card." It creates fluid embeds that will look
great at any width.
TimelineSetter "bakes out" timelines, ready for uploading directly into your
CMS, Amazon S3, or however you typically serve static files. It requires no
server-side processing at all once you've generated a timeline.
TimelineSetter [source on Github](https://github.com/propublica/timeline-setter/).
## Assorted Docs and Samples
* TimelineSetter Ruby source [documentation](documentation/index.html)
* timeline-setter.js [annotated source](doc/timeline-setter.html)
* A [TimelineSetter demo](doc/twitter-demo.html) using Twitter data
## How it Works
The project is broken into two parts: a Ruby package (along with a binary) for
generating the assets, and the HTML, CSS and JavaScript for the timeline
itself. TimelineSetter will create a unique HTML page that embeds a JSON
object with your data. The CSS and JavaScript are identical for every timeline
created, so you can host those centrally and simply point to them when you
deploy a timeline, or (with the minified option) you can package them up with your HTML
and paste it into your CMS all at once. You can [customize the CSS](#styling) to match the look
and feel of your site.
## Dependencies
TimelineSetter relies on [TableFu](http://propublica.github.com/table-fu/), as
well as the JavaScript libraries
[Underscore](http://documentcloud.github.com/underscore/) and
[jQuery](http://jquery.com/). All of these are either installed along with
TableSetter, or packaged with the source. It has been tested with jQuery 1.5.1
and Underscore 1.1.5.
## Installation
Install TimelineSetter through RubyGems on Unix-like OSes:
gem install timeline_setter
(Note: We haven't tested using the TimelineSetter tools on Windows even once,
though the timelines themselves have been tested in modern browsers on
Windows, Mac and Linux.)
## The \`timeline-setter\` command
After TimelineSetter is installed, the `timeline-setter` command should be
available in your shell. The command looks for a CSV file to parse and outputs
static assets. At any point, you can find help by running `timeline-setter`
without any arguments, or by adding the `-h` flag. Run the command like so:
timeline-setter -c /path/to/data.csv -o /path/to/output/directory
Running `timeline-setter` with no `-o` option will generate the timeline (and
supporting assets if applicable) within the current directory.
Full list of options:
* `-c CSV` Path to your CSV file.
* `-o OUTPUT_PATH` Path to output timeline and assets. If absent, timeline will be created in current directory.
* `-a` Add the default supporting assets to the output directory, along with the timeline itself.
* `-m` Create a minified one-page version of your timeline with all supporting assets inline.
* `-O` Open a browser to your new timeline after it is generated (currently Mac OS only).
* `-h` Print help to standard output.
## Setting Up Your CSV File
TimelineSetter looks for certain column names in your CSV file in order to
generate a timeline. All columns are required, though as you'll see, some of
them can be left blank. Here's a summary of each column and its significance:
### date
The date the event happened. Right now, TimelineSetter only supports
single-date events, but this can be specific down to the second. The generator
will try its best to parse out human dates. Try "March 20, 2010," "3/20/2010,"
"Mar. 20, 2010 11:59 PM" etc.
### display\_date
The date *displayed* on the event's card in the timeline. If this is blank, it
will fall back to `date`
### description
A description of the event.
### link
A URL to send users to more details about an event. This will generate a "read
more" button at the bottom of the card pointing to the URL.
### series
A string representing the name of the series of events this particular event
is a part of. TimelineSetter will find all the unique series among events in
the spreadsheet and assign both colors and checkboxes for them at the top of
the spreadsheet. Events not assigned to a series will be part of the "default"
series, which have their timeline notches colored charcoal, and have no
associated checkbox. **Note:** As a corollary, if you only have one series, it is
best not to assign a name.
### html
Any arbitrary HTML that will be inserted above `description`. This
field may contain image tags, YouTube tags, etc. -- nearly everything except
`