deckrb 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/README.md +84 -25
  2. data/bin/deck +3 -4
  3. data/lib/deck/rack_app.rb +39 -7
  4. data/lib/deck/slide.rb +9 -2
  5. data/lib/deck/slide_deck.rb +10 -13
  6. data/lib/deck/version.rb +1 -1
  7. data/public/coderay.css +84 -0
  8. data/public/deck.js/GPL-license.txt +278 -0
  9. data/public/deck.js/MIT-license.txt +21 -0
  10. data/public/deck.js/README.md +57 -0
  11. data/public/deck.js/core/deck.core.css +404 -0
  12. data/public/deck.js/core/deck.core.html +39 -0
  13. data/public/deck.js/core/deck.core.js +498 -0
  14. data/public/deck.js/core/deck.core.scss +447 -0
  15. data/public/deck.js/extensions/goto/deck.goto.css +41 -0
  16. data/public/deck.js/extensions/goto/deck.goto.html +7 -0
  17. data/public/deck.js/extensions/goto/deck.goto.js +134 -0
  18. data/public/deck.js/extensions/goto/deck.goto.scss +46 -0
  19. data/public/deck.js/extensions/hash/deck.hash.css +13 -0
  20. data/public/deck.js/extensions/hash/deck.hash.html +2 -0
  21. data/public/deck.js/extensions/hash/deck.hash.js +129 -0
  22. data/public/deck.js/extensions/hash/deck.hash.scss +15 -0
  23. data/public/deck.js/extensions/menu/deck.menu.css +47 -0
  24. data/public/deck.js/extensions/menu/deck.menu.js +187 -0
  25. data/public/deck.js/extensions/menu/deck.menu.scss +58 -0
  26. data/public/deck.js/extensions/navigation/deck.navigation.css +43 -0
  27. data/public/deck.js/extensions/navigation/deck.navigation.html +3 -0
  28. data/public/deck.js/extensions/navigation/deck.navigation.js +91 -0
  29. data/public/deck.js/extensions/navigation/deck.navigation.scss +56 -0
  30. data/public/deck.js/extensions/scale/deck.scale.css +16 -0
  31. data/public/deck.js/extensions/scale/deck.scale.js +156 -0
  32. data/public/deck.js/extensions/scale/deck.scale.scss +17 -0
  33. data/public/deck.js/extensions/status/deck.status.css +18 -0
  34. data/public/deck.js/extensions/status/deck.status.html +6 -0
  35. data/public/deck.js/extensions/status/deck.status.js +95 -0
  36. data/public/deck.js/extensions/status/deck.status.scss +22 -0
  37. data/public/deck.js/extensions/theme-picker/deck.theme-picker.css +55 -0
  38. data/public/deck.js/extensions/theme-picker/deck.theme-picker.js +13 -0
  39. data/public/deck.js/introduction/index.html +221 -0
  40. data/public/deck.js/introduction/index.rb +101 -0
  41. data/public/deck.js/jquery-1.7.min.js +4 -0
  42. data/public/deck.js/modernizr.custom.js +4 -0
  43. data/public/deck.js/test/fixtures/complex.html +24 -0
  44. data/public/deck.js/test/fixtures/empty.html +19 -0
  45. data/public/deck.js/test/fixtures/iframe_simple.html +10 -0
  46. data/public/deck.js/test/fixtures/iframes.html +32 -0
  47. data/public/deck.js/test/fixtures/nesteds.html +36 -0
  48. data/public/deck.js/test/fixtures/standard.html +42 -0
  49. data/public/deck.js/test/index.html +39 -0
  50. data/public/deck.js/test/lib/jasmine-html.js +190 -0
  51. data/public/deck.js/test/lib/jasmine-jquery.js +288 -0
  52. data/public/deck.js/test/lib/jasmine.css +166 -0
  53. data/public/deck.js/test/lib/jasmine.js +2477 -0
  54. data/public/deck.js/test/settings.js +3 -0
  55. data/public/deck.js/test/spec.core.js +434 -0
  56. data/public/deck.js/test/spec.goto.js +119 -0
  57. data/public/deck.js/test/spec.hash.js +81 -0
  58. data/public/deck.js/test/spec.menu.js +66 -0
  59. data/public/deck.js/test/spec.navigation.js +51 -0
  60. data/public/deck.js/test/spec.scale.js +57 -0
  61. data/public/deck.js/test/spec.status.js +58 -0
  62. data/public/deck.js/themes/style/neon.css +114 -0
  63. data/public/deck.js/themes/style/neon.scss +139 -0
  64. data/public/deck.js/themes/style/swiss.css +75 -0
  65. data/public/deck.js/themes/style/swiss.scss +91 -0
  66. data/public/deck.js/themes/style/web-2.0.css +205 -0
  67. data/public/deck.js/themes/style/web-2.0.scss +236 -0
  68. data/public/deck.js/themes/transition/fade.css +44 -0
  69. data/public/deck.js/themes/transition/fade.scss +70 -0
  70. data/public/deck.js/themes/transition/horizontal-slide.css +79 -0
  71. data/public/deck.js/themes/transition/horizontal-slide.scss +94 -0
  72. data/public/deck.js/themes/transition/vertical-slide.css +97 -0
  73. data/public/deck.js/themes/transition/vertical-slide.scss +116 -0
  74. data/public/favicon.ico +0 -0
  75. data/spec/rack_app_spec.rb +101 -33
  76. data/spec/slide_deck_spec.rb +6 -7
  77. data/spec/slide_spec.rb +19 -0
  78. metadata +95 -16
data/README.md CHANGED
@@ -1,53 +1,101 @@
1
1
  # deck.rb
2
2
 
3
- *curing deck.js of angle bracket addiction*
3
+ *slides in markdown, using deck.js*
4
4
 
5
- ## Summary
5
+
6
+ ## Installation
7
+
8
+ gem install deckrb
9
+
10
+ ## Usage
11
+
12
+ Put this in a file named `meals.md`:
13
+
14
+ # Breakfast
15
+ * scrambled eggs
16
+ * coffee
17
+ * bacon
18
+
19
+ # Lunch
20
+ ## Ham Sandwich
21
+ ## Caesar Salad
22
+
23
+ <!SLIDE>
24
+ ![a picture of my lunch](ham-sandwich.jpg)
25
+
26
+ # Dinner
27
+ > "To eat is to live." -Anon.
28
+
29
+ then run this:
30
+
31
+ deck meals.md
32
+
33
+ and you'll get a web server running on `http://localhost:4333` serving up a slide presentation with four slides:
34
+
35
+ * One titled "Breakfast" with three bullet points
36
+ * One titled "Lunch" with three H2 headers ("Lunch", "Ham Sandwich", and "Caesar Salad")
37
+ * One with no headers, just a picture (stored in the same directory as `meals.md`)
38
+ * One titled "Dinner" with a blockquote
39
+
40
+ ## Details
6
41
 
7
42
  [deck.js](http://imakewebthings.github.com/deck.js) is a JavaScript library for building slide presentations using HTML 5. [deck.rb](http://github.com/alexch/deck.rb) builds on top of deck.js, adding some features:
8
43
 
9
44
  * clean(ish) page skeleton allows you to focus on your slides, not the HTML/CSS infrastructure
10
45
  * multiple slide source formats, including
11
- * Erector
12
46
  * Markdown
13
47
  * presentations can comprise several source files
14
48
  * source files look good as source, built HTML, preview HTML, or as a deck doc
49
+ * each H1 designates the beginning of a new slide
50
+ * explicit `!SLIDE` or `<!SLIDE>` directives can split slides too
15
51
  * slide directives look like comments when rendered into HTML (e.g. as &lt;!SLIDE&gt;)
16
- * links to auxiliary files (e.g. `img src`) are resolved relative to the source file
17
- * generated HTML is pretty-printed
52
+ * generated HTML is pretty-printed for easier "view source"
53
+ * links to auxiliary files (e.g. `img src`) are resolved relative to the source file -- no more broken images in markdown previews!
54
+ * add CSS classes to slides inside the slide directive -- e.g. `<!SLIDE center>` gives `<section class="slide center">`
55
+ * uses deck.js` "swiss" theme and several extensions, including `goto`, `menu`, `navigation`, `status`, `hash`, and `scale`
18
56
  * uses RedCarpet markdown extensions, including
19
57
  * tables <http://michelf.com/projects/php-markdown/extra/#table>
20
58
  * fenced code blocks <http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks>
59
+ * mostly compatible with Showoff
60
+ * specifying 'showoff.json' on the command line loads all slides in its 'sections' section
61
+ * if the parameter starts with '# ' then it's parsed as literal markdown, not a file
62
+ * code syntax highlighting using Coderay
63
+ * specify language at the top of the block using either ::: or @@@
64
+ * e.g. `@@@ ruby`
21
65
 
22
- ## Command-Line API (proposed)
66
+ ## Command-Line API
23
67
 
24
68
  `deck run foo.md`
25
69
 
26
70
  * start a local Rack server (probably Sinatra) on port 4333
27
- * http://localhost:4333/ serves the presentation in foo.md
71
+ * http://localhost:4333/ serves the presentation built from `foo.md`
28
72
  * can specify multiple source files in a row
73
+ * can also specify a showoff.json file to load multiple markdown files
29
74
 
30
75
  `deck build foo.md`
31
76
 
32
- * create a static site
33
- * default output dir = ./public (even if foo.md is elsewhere)
34
- * copies deck.js source
35
- * also copies "img" directory if it exists
36
-
37
- `deck deploy` ???
38
-
39
- * some way to build/rebuild a project that is deployable to heroku
77
+ * creates a static page `foo.html` in the current directory
78
+ * unfortunately the `deck.js` source code will not be around so this won't really work yet
40
79
 
41
80
  ### Options
42
81
 
43
82
  * none yet :-)
44
83
 
84
+ ## Command-Line API (proposed)
85
+
86
+ `deck build foo.md`
87
+
88
+ * create a static site
89
+ * default output dir = ./public (even if foo.md is elsewhere)
90
+ * copies (or inlines) deck.js source
91
+ * also copies (or inlines) "img" directory if it exists
92
+
45
93
  ## Credits
46
94
 
47
95
  * deck.js by Caleb at <http://imakewebthings.com>
48
96
  * deck.rb by Alex Chaffee <http://alexchaffee.com>, with help from
49
97
  * Steven! Ragnarök <http://nuclearsandwich.com>
50
-
98
+
51
99
  ### See Also
52
100
 
53
101
  * showoff by Scott Chacon
@@ -55,38 +103,49 @@
55
103
 
56
104
  ## Bugs and Limitations
57
105
 
58
- * auxiliary files are interleaved in URL path space, so overlapping file names might not resolve to the right file
59
- * H1s are converted to H2s for compatibility with deck.js's CSS
106
+ * auxiliary files (e.g. images) are interleaved in URL path space, so overlapping file names might not resolve to the right file
107
+ * todo: rewrite internal links to files and serve them relative to current dir, not slide dir
108
+ * H1s (which split slides) are converted to H2s for compatibility with deck.js's CSS themes
60
109
  * unless they're the only item on the slide, in which case they remain H1s
110
+ * we use RedCarpet to process markdown, which doesn't work exactly the same as RDiscount... for example:
111
+ * indented code blocks under a bullet point may need to be indented more
112
+ * code blocks must be separated from the previous text by a newline
61
113
 
62
114
  ## TODO
63
115
 
64
- * config file
65
- * config:
116
+ * fix title tag (base it off of presentation name or something)
117
+ * scale images to fit on the page
118
+
119
+ * if no files are specified, use either './showoff.json' or all `.md` files under current directory
120
+ * deck.json config file
121
+ * config options:
66
122
  * show/hide theme selector
67
123
  * show/hide page number/nav
68
124
  * choose deck extensions
125
+ * theme
126
+ * specify which Redcarpet Markdown extensions to use
69
127
  * command-line tool can take a directory
70
128
  * first pass: globs all *.md files in it
71
- * command-line options:
129
+ * command-line options (overriding or complementing config file options)
72
130
  * --output dir
73
131
  * --config deck.json
74
132
  * --port portnum
75
133
  * --theme themename
76
134
  * more slide file types
135
+ * Erector - `foo/bar_bar.rb` would expect `class BarBar < Deck::Slide` in there
77
136
  * html
78
137
  * slim http://slim-lang.com/index.html
79
138
  * haml
80
139
  * tilt
81
- * specify Redcarpet Markdown extensions
82
- * option to render all JS and CSS inline, for a self-contained HTML doc
140
+ * option to render all JS and CSS inline, for a self-contained HTML doc
83
141
  * and maybe images too, base64-encoded
84
- * image scaling
85
142
  * build and push into a gh-pages branch
86
143
  * build and push into a heroku app
87
144
  * find any lines that start with a <p>.(something) and turn them into <p class="something">
88
145
  * see showoff.rb:189
89
- * fix title tag (base it off of presentation name or something)
146
+ * some way to build/rebuild a project that is deployable to heroku
147
+ * PDF
148
+ * rewrite internal links to files and serve them relative to current dir, not slide dir
90
149
 
91
150
  ## TODO (community)
92
151
 
data/bin/deck CHANGED
@@ -20,7 +20,7 @@ when 'build'
20
20
  # output_dir ||= File.dirname(arg)
21
21
  basename ||= File.basename(arg, ".md")
22
22
  output_path ||= "#{output_dir}/#{basename}.html"
23
-
23
+
24
24
  slides += Slide.from_file arg
25
25
  end
26
26
 
@@ -35,7 +35,6 @@ when 'run'
35
35
  # Fix Rack bug https://github.com/rack/rack/issues/301
36
36
  require 'deck/rack_static_patch'
37
37
 
38
-
39
38
  port = 4333 # todo: option
40
39
  slide_files = ARGV
41
40
  Rack::Handler.default.run Deck::RackApp.build(slide_files), :Port => port
@@ -44,11 +43,11 @@ else
44
43
  puts "Unknown command '#{command}'"
45
44
  puts <<-USAGE
46
45
  Usage:
46
+ deck run src.md...
47
47
  deck build src.md...
48
48
 
49
- deck run src.md...
49
+ see http://github.com/alexch/deck.rb README for more help.
50
50
 
51
51
  USAGE
52
52
  exit 1
53
53
  end
54
-
data/lib/deck/rack_app.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  here = File.expand_path File.dirname(__FILE__)
2
2
 
3
+ require 'json'
3
4
  require 'coderay'
4
5
  require 'rack/codehighlighter'
6
+ require 'deck'
5
7
 
6
8
  module Deck
7
9
  class RackApp
@@ -30,23 +32,37 @@ module Deck
30
32
  end
31
33
 
32
34
  def initialize slide_files
33
- @slide_files = [slide_files].flatten
35
+ @slide_files = [slide_files].flatten.map do |slide_file|
36
+ case slide_file
37
+ when /\/?showoff.json$/
38
+ json_file_dir = File.expand_path(File.dirname(slide_file))
39
+ json_file = slide_file
40
+ config = JSON.parse(File.read(json_file))
41
+ config['sections'].map do |markdown_file|
42
+ if markdown_file =~ /^# / # you can use literal markdown instead of a file name
43
+ s = Slide.split(markdown_file)
44
+ s
45
+ else
46
+ File.new(json_file_dir + '/' + markdown_file)
47
+ end
48
+ end
49
+ else
50
+ File.new(slide_file)
51
+ end
52
+ end.flatten
34
53
 
35
54
  @file_servers =
36
55
  [Rack::File.new("#{::Deck::RackApp.app_root}/public")] +
37
56
  @slide_files.map do |slide_file|
38
- Rack::File.new(File.dirname slide_file)
57
+ File.expand_path File.dirname(slide_file) if slide_file.is_a? File
58
+ end.compact.uniq.map do |slide_file_dir|
59
+ Rack::File.new(slide_file_dir)
39
60
  end
40
61
  end
41
62
 
42
63
  def call env
43
64
  request = Rack::Request.new(env)
44
65
  if request.path == "/"
45
- slides = []
46
- @slide_files.each do |file|
47
- slides += Slide.from_file file
48
- end
49
- deck = SlideDeck.new :slides => slides
50
66
  [200, {'Content-Type' => 'text/html'}, [deck.to_pretty]]
51
67
  else
52
68
  result = [404, {}, []]
@@ -57,5 +73,21 @@ module Deck
57
73
  result
58
74
  end
59
75
  end
76
+
77
+ def deck
78
+ SlideDeck.new :slides => slides
79
+ end
80
+
81
+ def slides
82
+ out = []
83
+ @slide_files.each do |file|
84
+ out += if file.is_a? Slide
85
+ [file]
86
+ else
87
+ Slide.from_file file
88
+ end
89
+ end
90
+ out
91
+ end
60
92
  end
61
93
  end
data/lib/deck/slide.rb CHANGED
@@ -13,6 +13,7 @@ module Deck
13
13
  end
14
14
 
15
15
  # given a chunk of Markdown text, splits it into an array of Slide objects
16
+ # todo: move into SlideDeck?
16
17
  def self.split content
17
18
  unless content =~ /^\<?!SLIDE/m # this only applies to files with no !SLIDEs at all, which is odd
18
19
  content = content.
@@ -47,8 +48,8 @@ module Deck
47
48
 
48
49
  attr_reader :classes, :markdown_text
49
50
 
50
- needs :classes => nil, :markdown_text => nil, :slide_id => nil
51
-
51
+ needs :classes => nil, :slide_id => nil
52
+ needs :markdown_text => nil
52
53
 
53
54
  def initialize options = {}
54
55
  super options
@@ -57,6 +58,12 @@ module Deck
57
58
  @markdown_text = ""
58
59
  end
59
60
 
61
+ def ==(other)
62
+ Slide === other and
63
+ @classes == other.classes and
64
+ @markdown_text == other.markdown_text
65
+ end
66
+
60
67
  def process_classes
61
68
  ["slide"] + case @classes
62
69
  when NilClass
@@ -8,8 +8,17 @@ module Deck
8
8
  needs :title => "deck.rb presentation",
9
9
  :description => nil,
10
10
  :author => nil
11
-
11
+ needs :extensions => [
12
+ 'goto',
13
+ 'menu',
14
+ 'navigation',
15
+ 'status',
16
+ 'hash',
17
+ 'scale',
18
+ # 'theme-picker',
19
+ ]
12
20
  needs :slides => nil
21
+ attr_reader :extensions
13
22
 
14
23
  def page_title
15
24
  @title
@@ -34,18 +43,6 @@ module Deck
34
43
  link({:rel => "stylesheet", :href => src}.merge(attributes))
35
44
  end
36
45
 
37
- def extensions
38
- @extensions || [
39
- 'goto',
40
- 'menu',
41
- 'navigation',
42
- 'status',
43
- 'hash',
44
- 'scale',
45
- # 'theme-picker',
46
- ]
47
- end
48
-
49
46
  def head_content
50
47
  super
51
48
  meta 'charset' => 'utf-8'
data/lib/deck/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Deck
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,84 @@
1
+ /* Code ray css */
2
+
3
+ .CodeRay { background: white; padding: 10px }
4
+
5
+ .CodeRay .line-numbers a:target { color: blue !important; }
6
+ .CodeRay .line-numbers .highlighted { color: red !important; }
7
+ .CodeRay .line-numbers .highlighted a { color: red !important; }
8
+ .CodeRay span.line-numbers { padding: 0px 4px; }
9
+ .CodeRay .line { display: block; float: left; width: 100%; }
10
+ .CodeRay .code { width: 100%; }
11
+ .CodeRay .code pre { overflow: auto; }
12
+
13
+ .CodeRay .debug { color: white !important; background: blue !important; }
14
+
15
+ .CodeRay .annotation { color:#007 }
16
+ .CodeRay .attribute-name { color:#b48 }
17
+ .CodeRay .attribute-value { color:#700 }
18
+ .CodeRay .binary { color:#509 }
19
+ .CodeRay .char .content { color:#D20 }
20
+ .CodeRay .char .delimiter { color:#710 }
21
+ .CodeRay .char { color:#D20 }
22
+ .CodeRay .class { color:#B06; font-weight:bold }
23
+ .CodeRay .class-variable { color:#369 }
24
+ .CodeRay .color { color:#0A0 }
25
+ .CodeRay .comment { color:#777 }
26
+ .CodeRay .comment .char { color:#444 }
27
+ .CodeRay .comment .delimiter { color:#444 }
28
+ .CodeRay .complex { color:#A08 }
29
+ .CodeRay .constant { color:#036; font-weight:bold }
30
+ .CodeRay .decorator { color:#B0B }
31
+ .CodeRay .definition { color:#099; font-weight:bold }
32
+ .CodeRay .delimiter { color:black }
33
+ .CodeRay .directive { color:#088; font-weight:bold }
34
+ .CodeRay .doc { color:#970 }
35
+ .CodeRay .doc-string { color:#D42; font-weight:bold }
36
+ .CodeRay .doctype { color:#34b }
37
+ .CodeRay .entity { color:#800; font-weight:bold }
38
+ .CodeRay .error { color:#F00; background-color:#FAA }
39
+ .CodeRay .escape { color:#666 }
40
+ .CodeRay .exception { color:#C00; font-weight:bold }
41
+ .CodeRay .float { color:#60E }
42
+ .CodeRay .function { color:#06B; font-weight:bold }
43
+ .CodeRay .global-variable { color:#d70 }
44
+ .CodeRay .hex { color:#02b }
45
+ .CodeRay .imaginary { color:#f00 }
46
+ .CodeRay .include { color:#B44; font-weight:bold }
47
+ .CodeRay .inline { background-color: hsla(0,0%,0%,0.07); color: black }
48
+ .CodeRay .inline-delimiter { font-weight: bold; color: #666 }
49
+ .CodeRay .instance-variable { color:#33B }
50
+ .CodeRay .integer { color:#00D }
51
+ .CodeRay .key .char { color: #60f }
52
+ .CodeRay .key .delimiter { color: #404 }
53
+ .CodeRay .key { color: #606 }
54
+ .CodeRay .keyword { color:#080; font-weight:bold }
55
+ .CodeRay .label { color:#970; font-weight:bold }
56
+ .CodeRay .local-variable { color:#963 }
57
+ .CodeRay .namespace { color:#707; font-weight:bold }
58
+ .CodeRay .octal { color:#40E }
59
+ .CodeRay .operator { }
60
+ .CodeRay .predefined { color:#369; font-weight:bold }
61
+ .CodeRay .predefined-constant { color:#069 }
62
+ .CodeRay .predefined-type { color:#0a5; font-weight:bold }
63
+ .CodeRay .preprocessor { color:#579 }
64
+ .CodeRay .pseudo-class { color:#00C; font-weight:bold }
65
+ .CodeRay .regexp .content { color:#808 }
66
+ .CodeRay .regexp .delimiter { color:#404 }
67
+ .CodeRay .regexp .modifier { color:#C2C }
68
+ .CodeRay .regexp { background-color:hsla(300,100%,50%,0.06); }
69
+ .CodeRay .reserved { color:#080; font-weight:bold }
70
+ .CodeRay .shell .content { color:#2B2 }
71
+ .CodeRay .shell .delimiter { color:#161 }
72
+ .CodeRay .shell { background-color:hsla(120,100%,50%,0.06); }
73
+ .CodeRay .string .char { color: #b0b }
74
+ .CodeRay .string .content { color: #D20 }
75
+ .CodeRay .string .delimiter { color: #710 }
76
+ .CodeRay .string .modifier { color: #E40 }
77
+ .CodeRay .string { background-color:hsla(0,100%,50%,0.05); }
78
+ .CodeRay .symbol .content { color:#A60 }
79
+ .CodeRay .symbol .delimiter { color:#630 }
80
+ .CodeRay .symbol { color:#A60 }
81
+ .CodeRay .tag { color:#070 }
82
+ .CodeRay .type { color:#339; font-weight:bold }
83
+ .CodeRay .value { color: #088; }
84
+ .CodeRay .variable { color:#037 }
@@ -0,0 +1,278 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.