timeline_setter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/LICENSE.txt +18 -0
- data/README +15 -0
- data/Rakefile +98 -0
- data/bin/timeline-setter +9 -0
- data/doc/doc.markdown +253 -0
- data/doc/doc_wrapper.erb +87 -0
- data/doc/docco.css +186 -0
- data/doc/timeline-setter.html +592 -0
- data/doc/todo.markdown +28 -0
- data/doc/twitter-demo.html +122 -0
- data/documentation/TimelineSetter/CLI.html +575 -0
- data/documentation/TimelineSetter/Parser.html +285 -0
- data/documentation/TimelineSetter/Timeline.html +513 -0
- data/documentation/TimelineSetter/Util.html +246 -0
- data/documentation/TimelineSetter.html +112 -0
- data/documentation/_index.html +132 -0
- data/documentation/class_list.html +36 -0
- data/documentation/css/common.css +1 -0
- data/documentation/css/full_list.css +53 -0
- data/documentation/css/style.css +318 -0
- data/documentation/file.README.html +70 -0
- data/documentation/file_list.html +38 -0
- data/documentation/frames.html +13 -0
- data/documentation/index.html +70 -0
- data/documentation/js/app.js +203 -0
- data/documentation/js/full_list.js +149 -0
- data/documentation/js/jquery.js +16 -0
- data/documentation/method_list.html +155 -0
- data/documentation/top-level-namespace.html +88 -0
- data/index.html +397 -0
- data/lib/timeline_setter/cli.rb +85 -0
- data/lib/timeline_setter/parser.rb +28 -0
- data/lib/timeline_setter/timeline.rb +44 -0
- data/lib/timeline_setter/version.rb +3 -0
- data/lib/timeline_setter.rb +22 -0
- data/public/javascripts/timeline-setter.js +822 -0
- data/public/javascripts/vendor/jquery-min.js +16 -0
- data/public/javascripts/vendor/underscore-min.js +26 -0
- data/public/stylesheets/timeline-setter.css +396 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/test_data.csv +4 -0
- data/spec/timeline_setter_spec.rb +85 -0
- data/templates/timeline-markup.erb +61 -0
- data/templates/timeline-min.erb +1 -0
- data/templates/timeline.erb +12 -0
- data/timeline_setter.gemspec +104 -0
- metadata +189 -0
data/.document
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright © 2011 ProPublica
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the “Software”), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to
|
8
|
+
do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
17
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
=
|
2
|
+
'
|
3
|
+
_______ ___ _____ __ __
|
4
|
+
/_ __(_)___ ___ ___ / (_)___ ___ / ___/___ / /_/ /____ _____
|
5
|
+
/ / / / __ `__ \/ _ \/ / / __ \/ _ \\__ \/ _ \/ __/ __/ _ \/ ___/
|
6
|
+
/ / / / / / / / / __/ / / / / / __/__/ / __/ /_/ /_/ __/ /
|
7
|
+
/_/ /_/_/ /_/ /_/\___/_/_/_/ /_/\___/____/\___/\__/\__/\___/_/
|
8
|
+
|
9
|
+
TimelineSetter is a tool to create HTML timelines from spreadsheets of events.
|
10
|
+
|
11
|
+
For usage and installation instructions, see:
|
12
|
+
http://propublica.github.com/timeline-setter/
|
13
|
+
|
14
|
+
To report a bug or suggest a feature:
|
15
|
+
http://github.com/propublica/timeline-setter/issues
|
data/Rakefile
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
require './lib/timeline_setter'
|
7
|
+
|
8
|
+
|
9
|
+
desc "build docs"
|
10
|
+
task :docs do
|
11
|
+
require 'rdiscount'
|
12
|
+
require 'erb'
|
13
|
+
version = TimelineSetter::VERSION
|
14
|
+
license = File.open('LICENSE.txt','r').read
|
15
|
+
mdown = RDiscount.new(ERB.new(File.open('doc/doc.markdown','r').read).result(binding), :smart).to_html
|
16
|
+
wrapper = File.open('doc/doc_wrapper.erb','r').read
|
17
|
+
mdown = File.open('index.html','w+') do |f|
|
18
|
+
f.write ERB.new(wrapper).result(binding)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "generate gh-pages"
|
23
|
+
task :gh_pages do
|
24
|
+
`rake docs`
|
25
|
+
`rake yard`
|
26
|
+
`rake docco`
|
27
|
+
`rake sample`
|
28
|
+
|
29
|
+
`git branch` =~ /^\* (.+)?\n/
|
30
|
+
current_branch = $1
|
31
|
+
|
32
|
+
`git commit -am "docs"`
|
33
|
+
`git push github #{current_branch}`
|
34
|
+
`git checkout gh-pages`
|
35
|
+
`git merge #{current_branch}`
|
36
|
+
`git push github gh-pages`
|
37
|
+
`git checkout #{current_branch}`
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "generate docco"
|
41
|
+
task :docco do
|
42
|
+
`docco ./public/javascripts/*.js`
|
43
|
+
`cp -R ./docs/* ./doc`
|
44
|
+
`rm -R docs`
|
45
|
+
end
|
46
|
+
|
47
|
+
begin
|
48
|
+
require 'jeweler'
|
49
|
+
Jeweler::Tasks.new do |gem|
|
50
|
+
gem.name = "timeline_setter"
|
51
|
+
gem.summary = %Q{TimelineSetter is a tool to create HTML timelines from spreadsheets of events.}
|
52
|
+
gem.description = %Q{TimelineSetter is a tool to create HTML timelines from spreadsheets of events.}
|
53
|
+
gem.email = "almshaw@gmail.com"
|
54
|
+
gem.homepage = "http://github.com/propublica/timeline-setter"
|
55
|
+
gem.authors = ["Al Shaw", "Jeff Larson"]
|
56
|
+
gem.executables = "timeline-setter"
|
57
|
+
gem.require_paths = ['lib']
|
58
|
+
gem.add_dependency "json"
|
59
|
+
gem.add_dependency "table_fu"
|
60
|
+
gem.add_dependency "kompress", ">= 0.0.2"
|
61
|
+
gem.add_dependency "closure-compiler"
|
62
|
+
gem.add_development_dependency "rspec", ">= 2.0.0"
|
63
|
+
gem.version = TimelineSetter::VERSION
|
64
|
+
end
|
65
|
+
Jeweler::GemcutterTasks.new
|
66
|
+
rescue LoadError
|
67
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
68
|
+
end
|
69
|
+
|
70
|
+
Rake::RDocTask.new do |rdoc|
|
71
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
72
|
+
rdoc.rdoc_dir = 'rdoc'
|
73
|
+
rdoc.title = "TimelineSetter #{version}"
|
74
|
+
rdoc.rdoc_files.include('README*')
|
75
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
76
|
+
end
|
77
|
+
|
78
|
+
# run tests with `rake spec`
|
79
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
80
|
+
spec.pattern = 'spec/*_spec.rb'
|
81
|
+
spec.rspec_opts = ['--color', '--format nested']
|
82
|
+
end
|
83
|
+
|
84
|
+
desc "generate yard docs"
|
85
|
+
task :yard do
|
86
|
+
`yard -o ./documentation`
|
87
|
+
end
|
88
|
+
|
89
|
+
desc "generate sample timeline"
|
90
|
+
task :sample do
|
91
|
+
# noop this for now.
|
92
|
+
|
93
|
+
# `./bin/timeline-setter -c ./tbi.csv -m -o ./public/`
|
94
|
+
# `cp ./public/timeline.html ./doc/timeline-sample.html`
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
|
data/bin/timeline-setter
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# $ ./bin/timeline-setter -c ./test.csv -o ./public/ -O
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require File.expand_path("../../lib/timeline_setter.rb", __FILE__)
|
7
|
+
require File.expand_path("../../lib/timeline_setter/cli.rb", __FILE__)
|
8
|
+
|
9
|
+
TimelineSetter::CLI.new
|
data/doc/doc.markdown
ADDED
@@ -0,0 +1,253 @@
|
|
1
|
+
# TimelineSetter <%= version %>
|
2
|
+
|
3
|
+
TimelineSetter creates beautiful timelines.
|
4
|
+
|
5
|
+
It is a command-line utility that takes a [specially-structured CSV file](#csv)
|
6
|
+
as input and outputs standards-compliant HTML/CSS/JavaScript. It supports any
|
7
|
+
span of time from minutes to years, and supports multiple parallel event
|
8
|
+
series in a single timeline. It can handle custom descriptions and even
|
9
|
+
arbitrary HTML in each event "card." It creates fluid embeds that will look
|
10
|
+
great at any width.
|
11
|
+
|
12
|
+
TimelineSetter "bakes out" timelines, ready for uploading directly into your
|
13
|
+
CMS, Amazon S3, or however you typically serve static files. It requires no
|
14
|
+
server-side processing at all once you've generated a timeline.
|
15
|
+
|
16
|
+
TimelineSetter [source on Github](https://github.com/propublica/timeline-setter/).
|
17
|
+
|
18
|
+
<a id="samples"></a>
|
19
|
+
## Assorted Docs and Samples
|
20
|
+
|
21
|
+
* TimelineSetter Ruby source [documentation](documentation/index.html)
|
22
|
+
* timeline-setter.js [annotated source](doc/timeline-setter.html)
|
23
|
+
* A [TimelineSetter demo](doc/twitter-demo.html) using Twitter data
|
24
|
+
|
25
|
+
<a id="innards"></a>
|
26
|
+
## How it Works
|
27
|
+
|
28
|
+
The project is broken into two parts: a Ruby package (along with a binary) for
|
29
|
+
generating the assets, and the HTML, CSS and JavaScript for the timeline
|
30
|
+
itself. TimelineSetter will create a unique HTML page that embeds a JSON
|
31
|
+
object with your data. The CSS and JavaScript are identical for every timeline
|
32
|
+
created, so you can host those centrally and simply point to them when you
|
33
|
+
deploy a timeline, or (with the minified option) you can package them up with your HTML
|
34
|
+
and paste it into your CMS all at once. You can [customize the CSS](#styling) to match the look
|
35
|
+
and feel of your site.
|
36
|
+
|
37
|
+
<a id="deps"></a>
|
38
|
+
## Dependencies
|
39
|
+
|
40
|
+
TimelineSetter relies on [TableFu](http://propublica.github.com/table-fu/), as
|
41
|
+
well as the JavaScript libraries
|
42
|
+
[Underscore](http://documentcloud.github.com/underscore/) and
|
43
|
+
[jQuery](http://jquery.com/). All of these are either installed along with
|
44
|
+
TableSetter, or packaged with the source. It has been tested with jQuery 1.5.1
|
45
|
+
and Underscore 1.1.5.
|
46
|
+
|
47
|
+
<a id="install"></a>
|
48
|
+
## Installation
|
49
|
+
|
50
|
+
Install TimelineSetter through RubyGems on Unix-like OSes:
|
51
|
+
|
52
|
+
gem install timeline_setter
|
53
|
+
|
54
|
+
(Note: We haven't tested using the TimelineSetter tools on Windows even once,
|
55
|
+
though the timelines themselves have been tested in modern browsers on
|
56
|
+
Windows, Mac and Linux.)
|
57
|
+
|
58
|
+
<a id="commandline"></a>
|
59
|
+
## The \`timeline-setter\` command
|
60
|
+
|
61
|
+
After TimelineSetter is installed, the `timeline-setter` command should be
|
62
|
+
available in your shell. The command looks for a CSV file to parse and outputs
|
63
|
+
static assets. At any point, you can find help by running `timeline-setter`
|
64
|
+
without any arguments, or by adding the `-h` flag. Run the command like so:
|
65
|
+
|
66
|
+
timeline-setter -c /path/to/data.csv -o /path/to/output/directory
|
67
|
+
|
68
|
+
Running `timeline-setter` with no `-o` option will generate the timeline (and
|
69
|
+
supporting assets if applicable) within the current directory.
|
70
|
+
|
71
|
+
Full list of options:
|
72
|
+
|
73
|
+
* `-c CSV` Path to your CSV file.
|
74
|
+
* `-o OUTPUT_PATH` Path to output timeline and assets. If absent, timeline will be created in current directory.
|
75
|
+
* `-a` Add the default supporting assets to the output directory, along with the timeline itself.
|
76
|
+
* `-m` Create a minified one-page version of your timeline with all supporting assets inline.
|
77
|
+
* `-O` Open a browser to your new timeline after it is generated (currently Mac OS only).
|
78
|
+
* `-h` Print help to standard output.
|
79
|
+
|
80
|
+
<a id="csv"></a>
|
81
|
+
## Setting Up Your CSV File
|
82
|
+
|
83
|
+
TimelineSetter looks for certain column names in your CSV file in order to
|
84
|
+
generate a timeline. All columns are required, though as you'll see, some of
|
85
|
+
them can be left blank. Here's a summary of each column and its significance:
|
86
|
+
|
87
|
+
<a id="date-csv"></a>
|
88
|
+
### date
|
89
|
+
|
90
|
+
The date the event happened. Right now, TimelineSetter only supports
|
91
|
+
single-date events, but this can be specific down to the second. The generator
|
92
|
+
will try its best to parse out human dates. Try "March 20, 2010," "3/20/2010,"
|
93
|
+
"Mar. 20, 2010 11:59 PM" etc.
|
94
|
+
|
95
|
+
<a id="display-date-csv"></a>
|
96
|
+
### display\_date
|
97
|
+
|
98
|
+
The date *displayed* on the event's card in the timeline. If this is blank, it
|
99
|
+
will fall back to `date`
|
100
|
+
|
101
|
+
<a id="desc-csv"></a>
|
102
|
+
### description
|
103
|
+
|
104
|
+
A description of the event.
|
105
|
+
|
106
|
+
<a id="link-csv"></a>
|
107
|
+
### link
|
108
|
+
|
109
|
+
A URL to send users to more details about an event. This will generate a "read
|
110
|
+
more" button at the bottom of the card pointing to the URL.
|
111
|
+
|
112
|
+
<a id="series-csv"></a>
|
113
|
+
### series
|
114
|
+
|
115
|
+
A string representing the name of the series of events this particular event
|
116
|
+
is a part of. TimelineSetter will find all the unique series among events in
|
117
|
+
the spreadsheet and assign both colors and checkboxes for them at the top of
|
118
|
+
the spreadsheet. Events not assigned to a series will be part of the "default"
|
119
|
+
series, which have their timeline notches colored charcoal, and have no
|
120
|
+
associated checkbox. **Note:** As a corollary, if you only have one series, it is
|
121
|
+
best not to assign a name.
|
122
|
+
|
123
|
+
<a id="html-csv"></a>
|
124
|
+
### html
|
125
|
+
|
126
|
+
Any arbitrary HTML that will be inserted above `description`. This
|
127
|
+
field may contain image tags, YouTube tags, etc. -- nearly everything except
|
128
|
+
`<script>` tags. If you choose to use JavaScript, you must do it inside an
|
129
|
+
iframe and call that iframe inside this field.
|
130
|
+
|
131
|
+
<a id="deployment"></a>
|
132
|
+
## Folder structure and deployment
|
133
|
+
|
134
|
+
After you've generated a timeline with the `timeline-setter` command, you
|
135
|
+
should see a structure much like this where you've specified your output:
|
136
|
+
|
137
|
+
|-output
|
138
|
+
|---timeline.html
|
139
|
+
|---javascripts
|
140
|
+
|-----timeline-setter.js
|
141
|
+
|-----vendor
|
142
|
+
|-------underscore-min.js
|
143
|
+
|-------jquery-min.js
|
144
|
+
|---stylesheets
|
145
|
+
|-----timeline-setter.css
|
146
|
+
|
147
|
+
Dropping the whole folder onto your server or an asset host like S3 will allow
|
148
|
+
the app to run self-contained. It requires no server-side processing at all.
|
149
|
+
To drop into your CMS, simply copy the relevant bits of `timeline.html` and
|
150
|
+
paste into your site's template. Then, adjust the `<link>` and `<script>` tags
|
151
|
+
to point to their appropriate destinations.
|
152
|
+
|
153
|
+
<a id="defn"></a>
|
154
|
+
## Definitions
|
155
|
+
|
156
|
+
The timeline is made up of non-clickable *interval notches* used to denote
|
157
|
+
periods of time, and *event notches*, which, when clicked, reveal their
|
158
|
+
associated *event cards*.
|
159
|
+
|
160
|
+
<a name="styling"></a>
|
161
|
+
## Styling Your Timeline
|
162
|
+
|
163
|
+
TimelineSetter timelines are fully style-able. The default "ProPublica theme"
|
164
|
+
stylesheet is packaged alongside each generated asset bundle, and is available
|
165
|
+
in `stylesheets/timeline-setter.css`. You can alter this stylesheet, or
|
166
|
+
replace it completely. Here's a guide to do that.
|
167
|
+
|
168
|
+
<a id="styling-container"></a>
|
169
|
+
### Overview and Styling the Container and Top Matter
|
170
|
+
|
171
|
+
All TimelineSetter CSS is scoped within a namespace starting with `TS.` The
|
172
|
+
outermost container is `#timeline_setter.`
|
173
|
+
|
174
|
+
Upon first glance, it may not seem like there is much markup at all. That's
|
175
|
+
because we make extensive use of JavaScript (ERB-style) templating via
|
176
|
+
[Underscore.js](http://documentcloud.github.com/underscore/#template) -- so
|
177
|
+
templates for each part of the timeline reside in the DOM. The controls (zoom
|
178
|
+
in/out, previous/next buttons) are available within `#TS-top_matter_container .TS-controls`.
|
179
|
+
|
180
|
+
Series checkboxes are injected into `.TS-series_nav_container` and templated
|
181
|
+
via `script#TS-notch_tmpl`. Currently, series colors are hard coded in the
|
182
|
+
JavaScript. We support a maximum of nine series colors (assigned in this order:
|
183
|
+
``#065718, #EDC047, #91ADD1, #929E5E, #9E5E23, #C44846, #065718, #EDD4A5, #CECECE``,
|
184
|
+
they can be overridden in the "color priority" section of `timeline-setter.css`). Technically
|
185
|
+
you can create an unlimited number of series, but they will eventually fall back
|
186
|
+
to the default charcoal notch color.
|
187
|
+
|
188
|
+
<a id="styling-bar"></a>
|
189
|
+
### Styling the bar, notches and cards
|
190
|
+
|
191
|
+
Interval notches are templated within `script#TS-year_notch_tmpl`. Their
|
192
|
+
position is based on the interval of time between events as automatically
|
193
|
+
determined by the JavaScript. Here's a sampling of what you might see in
|
194
|
+
interval notches:
|
195
|
+
|
196
|
+
year => 2001
|
197
|
+
month => June, 2004
|
198
|
+
day => May 1, 2005
|
199
|
+
hour/minute => 11:59
|
200
|
+
second => 11:59:22
|
201
|
+
|
202
|
+
Event notches are templated through `#TS-card-tmpl` and contain individual
|
203
|
+
classes corresponding to spreadsheet columns. `.TS-item-label` corresponds to
|
204
|
+
`description`, `.TS-item_html` corresponds to `html`,
|
205
|
+
`.TS-read_btn` is linked to `link` and `.TS-item_year` corresponds to
|
206
|
+
`display_date` falling through to `date`. Finally, `TS-permalink`
|
207
|
+
is a fragment link which will show the active card on page load if used.
|
208
|
+
|
209
|
+
<a id="roadmap"></a>
|
210
|
+
## Roadmap
|
211
|
+
|
212
|
+
On the client side, there are a number of features we plan to add, including:
|
213
|
+
|
214
|
+
* Smoother zooming
|
215
|
+
* Deactivating series checkboxes if none of its events are within the zoomed viewport
|
216
|
+
* Auto-zooming the timeline if embedded into smaller containers
|
217
|
+
* More iOS gestures such as "pinching"
|
218
|
+
* Zooming to fit a series when the series is activated
|
219
|
+
* Ranges of events (e.g. Elizabeth Taylor was married to Michael Wilding between
|
220
|
+
Feb. 21, 1952 and Jan. 26, 1957, as shown
|
221
|
+
[here](http://www.nytimes.com/interactive/2011/03/23/movies/20110323-ELIZABETH-TAYLOR-TIMELINE.html))
|
222
|
+
* Embed code
|
223
|
+
* JavaScript tests
|
224
|
+
|
225
|
+
<a id="links"></a>
|
226
|
+
## Links
|
227
|
+
|
228
|
+
* In the Wild: [ProPublica: How One Blast Affected Five Soldiers](http://www.propublica.org/special/tbi-psycho-platoon-timeline)
|
229
|
+
|
230
|
+
<a id="credits"></a>
|
231
|
+
## Credits
|
232
|
+
|
233
|
+
[Al Shaw](http://twitter.com/a_l), [Jeff Larson](http://github.com/thejefflarson), ProPublica
|
234
|
+
|
235
|
+
<a id="contact"></a>
|
236
|
+
## Contact
|
237
|
+
|
238
|
+
For issues with TimelineSetter, use the
|
239
|
+
[Issue Tracker](https://github.com/propublica/timeline-setter/issues). General
|
240
|
+
questions should go to <a href="mailto:opensource@propublica.org">opensource@propublica.org</a>.
|
241
|
+
|
242
|
+
<a id="changelog"></a>
|
243
|
+
## Change Log
|
244
|
+
|
245
|
+
<a id="release-001"></a>
|
246
|
+
### 0.1.0
|
247
|
+
|
248
|
+
Initial release
|
249
|
+
|
250
|
+
<a id="license"></a>
|
251
|
+
## License
|
252
|
+
|
253
|
+
<%= license %>
|
data/doc/doc_wrapper.erb
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
5
|
+
<link href="http://cloud.webtype.com/css/50942e7d-aebe-4c83-9824-ead7e49ec5af.css" rel="stylesheet" type="text/css" />
|
6
|
+
<style>
|
7
|
+
html {
|
8
|
+
background: #f7f7f7;
|
9
|
+
}
|
10
|
+
body {
|
11
|
+
font-family: Georgia, serif;
|
12
|
+
font-size: 16px;
|
13
|
+
line-height:24px;
|
14
|
+
width: 600px;
|
15
|
+
margin-left:auto;
|
16
|
+
margin-right:auto;
|
17
|
+
margin-top:10px;
|
18
|
+
background: #fff;
|
19
|
+
padding:10px 10px;
|
20
|
+
color:#444;
|
21
|
+
border-top:1px solid #cecece;
|
22
|
+
border-bottom:1px solid #cecece;
|
23
|
+
}
|
24
|
+
h1,h2,h3,h4,h5 {
|
25
|
+
font-family: 'Helvetica Neue', Arial, sans-serif;
|
26
|
+
color:#444;
|
27
|
+
}
|
28
|
+
h1 {
|
29
|
+
padding-top:0;
|
30
|
+
margin-top:0;
|
31
|
+
}
|
32
|
+
h2,h3 {
|
33
|
+
}
|
34
|
+
a.propublica{
|
35
|
+
position:absolute;
|
36
|
+
background: transparent url(http://propublica.github.com/table-fu/documentation/images/proplogo.png) no-repeat -40px -20px;
|
37
|
+
top: 0;
|
38
|
+
left: 0;
|
39
|
+
width: 160px;
|
40
|
+
height: 141px;
|
41
|
+
}
|
42
|
+
|
43
|
+
pre,code {
|
44
|
+
font-family: Monaco, Courier, monospace;
|
45
|
+
font-size:12px;
|
46
|
+
}
|
47
|
+
pre {
|
48
|
+
line-height: 16px;
|
49
|
+
padding:0.5em 1em;
|
50
|
+
overflow: auto;
|
51
|
+
border-left: 1px solid #cecece;
|
52
|
+
margin-left: 0;
|
53
|
+
background:#f7f7f7;
|
54
|
+
}
|
55
|
+
code {
|
56
|
+
padding: 2px;
|
57
|
+
background-color: #f7f7f7;
|
58
|
+
}
|
59
|
+
pre > code {
|
60
|
+
padding:0;
|
61
|
+
}
|
62
|
+
a {
|
63
|
+
color: #4369AF;
|
64
|
+
text-decoration: none;
|
65
|
+
font-weight: bold;
|
66
|
+
}
|
67
|
+
a:hover {
|
68
|
+
text-decoration:underline;
|
69
|
+
}
|
70
|
+
ul {
|
71
|
+
margin:0 1em;
|
72
|
+
padding:0;
|
73
|
+
list-style: disc;
|
74
|
+
}
|
75
|
+
li {
|
76
|
+
margin:0;
|
77
|
+
padding:0;
|
78
|
+
}
|
79
|
+
|
80
|
+
</style>
|
81
|
+
<title>TimelineSetter</title>
|
82
|
+
</head>
|
83
|
+
<body>
|
84
|
+
<a href="http://www.propublica.org" class="propublica"> </a>
|
85
|
+
<%= mdown %>
|
86
|
+
</body>
|
87
|
+
</html>
|
data/doc/docco.css
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
/*--------------------- Layout and Typography ----------------------------*/
|
2
|
+
body {
|
3
|
+
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
|
4
|
+
font-size: 15px;
|
5
|
+
line-height: 22px;
|
6
|
+
color: #252519;
|
7
|
+
margin: 0; padding: 0;
|
8
|
+
}
|
9
|
+
a {
|
10
|
+
color: #261a3b;
|
11
|
+
}
|
12
|
+
a:visited {
|
13
|
+
color: #261a3b;
|
14
|
+
}
|
15
|
+
p {
|
16
|
+
margin: 0 0 15px 0;
|
17
|
+
}
|
18
|
+
h1, h2, h3, h4, h5, h6 {
|
19
|
+
margin: 0px 0 15px 0;
|
20
|
+
}
|
21
|
+
h1 {
|
22
|
+
margin-top: 40px;
|
23
|
+
}
|
24
|
+
#container {
|
25
|
+
position: relative;
|
26
|
+
}
|
27
|
+
#background {
|
28
|
+
position: fixed;
|
29
|
+
top: 0; left: 525px; right: 0; bottom: 0;
|
30
|
+
background: #f5f5ff;
|
31
|
+
border-left: 1px solid #e5e5ee;
|
32
|
+
z-index: -1;
|
33
|
+
}
|
34
|
+
#jump_to, #jump_page {
|
35
|
+
background: white;
|
36
|
+
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
|
37
|
+
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
|
38
|
+
font: 10px Arial;
|
39
|
+
text-transform: uppercase;
|
40
|
+
cursor: pointer;
|
41
|
+
text-align: right;
|
42
|
+
}
|
43
|
+
#jump_to, #jump_wrapper {
|
44
|
+
position: fixed;
|
45
|
+
right: 0; top: 0;
|
46
|
+
padding: 5px 10px;
|
47
|
+
}
|
48
|
+
#jump_wrapper {
|
49
|
+
padding: 0;
|
50
|
+
display: none;
|
51
|
+
}
|
52
|
+
#jump_to:hover #jump_wrapper {
|
53
|
+
display: block;
|
54
|
+
}
|
55
|
+
#jump_page {
|
56
|
+
padding: 5px 0 3px;
|
57
|
+
margin: 0 0 25px 25px;
|
58
|
+
}
|
59
|
+
#jump_page .source {
|
60
|
+
display: block;
|
61
|
+
padding: 5px 10px;
|
62
|
+
text-decoration: none;
|
63
|
+
border-top: 1px solid #eee;
|
64
|
+
}
|
65
|
+
#jump_page .source:hover {
|
66
|
+
background: #f5f5ff;
|
67
|
+
}
|
68
|
+
#jump_page .source:first-child {
|
69
|
+
}
|
70
|
+
table td {
|
71
|
+
border: 0;
|
72
|
+
outline: 0;
|
73
|
+
}
|
74
|
+
td.docs, th.docs {
|
75
|
+
max-width: 450px;
|
76
|
+
min-width: 450px;
|
77
|
+
min-height: 5px;
|
78
|
+
padding: 10px 25px 1px 50px;
|
79
|
+
overflow-x: hidden;
|
80
|
+
vertical-align: top;
|
81
|
+
text-align: left;
|
82
|
+
}
|
83
|
+
.docs pre {
|
84
|
+
margin: 15px 0 15px;
|
85
|
+
padding-left: 15px;
|
86
|
+
}
|
87
|
+
.docs p tt, .docs p code {
|
88
|
+
background: #f8f8ff;
|
89
|
+
border: 1px solid #dedede;
|
90
|
+
font-size: 12px;
|
91
|
+
padding: 0 0.2em;
|
92
|
+
}
|
93
|
+
.pilwrap {
|
94
|
+
position: relative;
|
95
|
+
}
|
96
|
+
.pilcrow {
|
97
|
+
font: 12px Arial;
|
98
|
+
text-decoration: none;
|
99
|
+
color: #454545;
|
100
|
+
position: absolute;
|
101
|
+
top: 3px; left: -20px;
|
102
|
+
padding: 1px 2px;
|
103
|
+
opacity: 0;
|
104
|
+
-webkit-transition: opacity 0.2s linear;
|
105
|
+
}
|
106
|
+
td.docs:hover .pilcrow {
|
107
|
+
opacity: 1;
|
108
|
+
}
|
109
|
+
td.code, th.code {
|
110
|
+
padding: 14px 15px 16px 25px;
|
111
|
+
width: 100%;
|
112
|
+
vertical-align: top;
|
113
|
+
background: #f5f5ff;
|
114
|
+
border-left: 1px solid #e5e5ee;
|
115
|
+
}
|
116
|
+
pre, tt, code {
|
117
|
+
font-size: 12px; line-height: 18px;
|
118
|
+
font-family: Monaco, Consolas, "Lucida Console", monospace;
|
119
|
+
margin: 0; padding: 0;
|
120
|
+
}
|
121
|
+
|
122
|
+
|
123
|
+
/*---------------------- Syntax Highlighting -----------------------------*/
|
124
|
+
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
|
125
|
+
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
|
126
|
+
body .hll { background-color: #ffffcc }
|
127
|
+
body .c { color: #408080; font-style: italic } /* Comment */
|
128
|
+
body .err { border: 1px solid #FF0000 } /* Error */
|
129
|
+
body .k { color: #954121 } /* Keyword */
|
130
|
+
body .o { color: #666666 } /* Operator */
|
131
|
+
body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
|
132
|
+
body .cp { color: #BC7A00 } /* Comment.Preproc */
|
133
|
+
body .c1 { color: #408080; font-style: italic } /* Comment.Single */
|
134
|
+
body .cs { color: #408080; font-style: italic } /* Comment.Special */
|
135
|
+
body .gd { color: #A00000 } /* Generic.Deleted */
|
136
|
+
body .ge { font-style: italic } /* Generic.Emph */
|
137
|
+
body .gr { color: #FF0000 } /* Generic.Error */
|
138
|
+
body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
139
|
+
body .gi { color: #00A000 } /* Generic.Inserted */
|
140
|
+
body .go { color: #808080 } /* Generic.Output */
|
141
|
+
body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
142
|
+
body .gs { font-weight: bold } /* Generic.Strong */
|
143
|
+
body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
144
|
+
body .gt { color: #0040D0 } /* Generic.Traceback */
|
145
|
+
body .kc { color: #954121 } /* Keyword.Constant */
|
146
|
+
body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
|
147
|
+
body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
|
148
|
+
body .kp { color: #954121 } /* Keyword.Pseudo */
|
149
|
+
body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
|
150
|
+
body .kt { color: #B00040 } /* Keyword.Type */
|
151
|
+
body .m { color: #666666 } /* Literal.Number */
|
152
|
+
body .s { color: #219161 } /* Literal.String */
|
153
|
+
body .na { color: #7D9029 } /* Name.Attribute */
|
154
|
+
body .nb { color: #954121 } /* Name.Builtin */
|
155
|
+
body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
156
|
+
body .no { color: #880000 } /* Name.Constant */
|
157
|
+
body .nd { color: #AA22FF } /* Name.Decorator */
|
158
|
+
body .ni { color: #999999; font-weight: bold } /* Name.Entity */
|
159
|
+
body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
160
|
+
body .nf { color: #0000FF } /* Name.Function */
|
161
|
+
body .nl { color: #A0A000 } /* Name.Label */
|
162
|
+
body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
163
|
+
body .nt { color: #954121; font-weight: bold } /* Name.Tag */
|
164
|
+
body .nv { color: #19469D } /* Name.Variable */
|
165
|
+
body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
166
|
+
body .w { color: #bbbbbb } /* Text.Whitespace */
|
167
|
+
body .mf { color: #666666 } /* Literal.Number.Float */
|
168
|
+
body .mh { color: #666666 } /* Literal.Number.Hex */
|
169
|
+
body .mi { color: #666666 } /* Literal.Number.Integer */
|
170
|
+
body .mo { color: #666666 } /* Literal.Number.Oct */
|
171
|
+
body .sb { color: #219161 } /* Literal.String.Backtick */
|
172
|
+
body .sc { color: #219161 } /* Literal.String.Char */
|
173
|
+
body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
|
174
|
+
body .s2 { color: #219161 } /* Literal.String.Double */
|
175
|
+
body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
176
|
+
body .sh { color: #219161 } /* Literal.String.Heredoc */
|
177
|
+
body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
178
|
+
body .sx { color: #954121 } /* Literal.String.Other */
|
179
|
+
body .sr { color: #BB6688 } /* Literal.String.Regex */
|
180
|
+
body .s1 { color: #219161 } /* Literal.String.Single */
|
181
|
+
body .ss { color: #19469D } /* Literal.String.Symbol */
|
182
|
+
body .bp { color: #954121 } /* Name.Builtin.Pseudo */
|
183
|
+
body .vc { color: #19469D } /* Name.Variable.Class */
|
184
|
+
body .vg { color: #19469D } /* Name.Variable.Global */
|
185
|
+
body .vi { color: #19469D } /* Name.Variable.Instance */
|
186
|
+
body .il { color: #666666 } /* Literal.Number.Integer.Long */
|