webapidoc 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Rails Generator
8
8
 
9
- To copy sample config/webapidoc.yml and two sample files in app/documentation simply run
9
+ To copy sample config/webapidoc.yml and sample files in app/documentation simply run
10
10
 
11
11
  rails g webapidoc:install
12
12
 
@@ -21,3 +21,15 @@ To copy sample config/webapidoc.yml and two sample files in app/documentation si
21
21
  end
22
22
 
23
23
  end
24
+
25
+ ## Provide URL for live API Querys
26
+
27
+ set url option to a valid JSON API URL to use live querys
28
+
29
+
30
+ # Rendering Partials
31
+
32
+ like in rails:
33
+
34
+ <%= partial :welcome_message %>
35
+
@@ -14,8 +14,8 @@ module Webapidoc
14
14
  FileUtils.mkdir_p "app/documentation"
15
15
 
16
16
  # copy files
17
- FileUtils.copy(source_root + "/index.md.erb", "app/documentation")
18
- FileUtils.copy(source_root + "/sample.md.erb", "app/documentation")
17
+ FileUtils.copy(source_root + "/documentation.md.erb", "app/documentation")
18
+ FileUtils.copy(source_root + "/_partial.md.erb", "app/documentation")
19
19
  FileUtils.copy(source_root + "/webapidoc.yml", "config")
20
20
 
21
21
  puts "done"
@@ -0,0 +1 @@
1
+ a shiny partial
@@ -0,0 +1,166 @@
1
+ Index
2
+ ====================
3
+
4
+ Welcome
5
+ ---------------------
6
+
7
+ Now is the time for all good men to come to
8
+ the aid of their country.
9
+
10
+
11
+ ### Build with shiny partials!
12
+
13
+ <%= partial :partial %>
14
+
15
+ Formatting
16
+ ---------------------
17
+
18
+ ### Paragraphs
19
+
20
+ This is just a regular paragraph. Now is the time for all good men to come to
21
+ the aid of [their country](http://www.google.de). Look the link!
22
+
23
+ ### Lists
24
+
25
+ This is just an ordered list
26
+
27
+ 1. Bird
28
+ 2. McHale
29
+ 3. Parish
30
+
31
+ This is just a unordered list.
32
+
33
+ * Bird
34
+ * McHale
35
+ * Parish
36
+
37
+ ### Quotes
38
+
39
+ > This is a blockquote.
40
+ >
41
+ > This is the second paragraph in the blockquote.
42
+ >
43
+
44
+ ### Some Code
45
+
46
+ This is just some code.
47
+
48
+ [
49
+ {
50
+ "title": "apples",
51
+ "count": [12000, 20000],
52
+ "description": {"text": "...", "sensitive": false}
53
+ },
54
+ {
55
+ "title": "oranges",
56
+ "count": [17500, null],
57
+ "description": {"text": "...", "sensitive": false}
58
+ }
59
+ ]
60
+
61
+ This is some `code` within a paragraph. More to come!
62
+ This is just some more code.
63
+
64
+ [
65
+ {
66
+ "title": "apples",
67
+ "count": [12000, 20000],
68
+ "description": {"text": "...", "sensitive": false}
69
+ }
70
+ ]
71
+
72
+
73
+ Options
74
+ ====================
75
+
76
+ A new Chapter
77
+ ---------------------
78
+
79
+ Now is the time for all good men to come to
80
+ the aid of their country.
81
+
82
+
83
+ ### Samuel L. Ipsum
84
+
85
+ Your bones don't break, mine do. That's clear. Your cells react to
86
+ bacteria and viruses differently than mine. You don't get sick, I do.
87
+ That's also clear. But for some reason, you and I react the exact same
88
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
89
+ we drown. However unreal it may seem, we are connected, you and I.
90
+ We're on the same curve, just on opposite ends.
91
+
92
+ Your bones don't break, mine do. That's clear. Your cells react to
93
+ bacteria and viruses differently than mine. You don't get sick, I do.
94
+ That's also clear. But for some reason, you and I react the exact same
95
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
96
+ we drown. However unreal it may seem, we are connected, you and I.
97
+ We're on the same curve, just on opposite ends.
98
+
99
+ Your bones don't break, mine do. That's clear. Your cells react to
100
+ bacteria and viruses differently than mine. You don't get sick, I do.
101
+ That's also clear. But for some reason, you and I react the exact same
102
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
103
+ we drown. However unreal it may seem, we are connected, you and I.
104
+ We're on the same curve, just on opposite ends.
105
+
106
+ Your bones don't break, mine do. That's clear. Your cells react to
107
+ bacteria and viruses differently than mine. You don't get sick, I do.
108
+ That's also clear. But for some reason, you and I react the exact same
109
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
110
+ we drown. However unreal it may seem, we are connected, you and I.
111
+ We're on the same curve, just on opposite ends.
112
+
113
+ Your bones don't break, mine do. That's clear. Your cells react to
114
+ bacteria and viruses differently than mine. You don't get sick, I do.
115
+ That's also clear. But for some reason, you and I react the exact same
116
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
117
+ we drown. However unreal it may seem, we are connected, you and I.
118
+ We're on the same curve, just on opposite ends.
119
+
120
+ More Stuff
121
+ ====================
122
+
123
+ Another Chapter
124
+ ---------------------
125
+
126
+ Now is the time for all good men to come to
127
+ the aid of their country.
128
+
129
+
130
+ ### More Ipsum
131
+
132
+ Your bones don't break, mine do. That's clear. Your cells react to
133
+ bacteria and viruses differently than mine. You don't get sick, I do.
134
+ That's also clear. But for some reason, you and I react the exact same
135
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
136
+ we drown. However unreal it may seem, we are connected, you and I.
137
+ We're on the same curve, just on opposite ends.
138
+
139
+ Your bones don't break, mine do. That's clear. Your cells react to
140
+ bacteria and viruses differently than mine. You don't get sick, I do.
141
+ That's also clear. But for some reason, you and I react the exact same
142
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
143
+ we drown. However unreal it may seem, we are connected, you and I.
144
+ We're on the same curve, just on opposite ends.
145
+
146
+ Your bones don't break, mine do. That's clear. Your cells react to
147
+ bacteria and viruses differently than mine. You don't get sick, I do.
148
+ That's also clear. But for some reason, you and I react the exact same
149
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
150
+ we drown. However unreal it may seem, we are connected, you and I.
151
+ We're on the same curve, just on opposite ends.
152
+
153
+ Your bones don't break, mine do. That's clear. Your cells react to
154
+ bacteria and viruses differently than mine. You don't get sick, I do.
155
+ That's also clear. But for some reason, you and I react the exact same
156
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
157
+ we drown. However unreal it may seem, we are connected, you and I.
158
+ We're on the same curve, just on opposite ends.
159
+
160
+ Your bones don't break, mine do. That's clear. Your cells react to
161
+ bacteria and viruses differently than mine. You don't get sick, I do.
162
+ That's also clear. But for some reason, you and I react the exact same
163
+ way to water. We swallow it too fast, we choke. We get some in our lungs,
164
+ we drown. However unreal it may seem, we are connected, you and I.
165
+ We're on the same curve, just on opposite ends.
166
+
@@ -1,11 +1,2 @@
1
1
  title: "WebAPIDoc"
2
- description: "Static HTML Documentation for JSON APIs"
3
- url: "http://localhost:3000"
4
-
5
- chapters:
6
- -
7
- file: "index"
8
- name: "Index Page"
9
- -
10
- file: "sample"
11
- name: "Sample Page"
2
+ description: "Static HTML Documentation for JSON APIs"
@@ -1,99 +1,117 @@
1
1
 
2
2
  module Webapidoc
3
3
 
4
- def self.gem_libdir
5
- t = ["#{File.dirname(File.expand_path($0))}/../lib/#{Webapidoc::NAME}",
6
- "#{Gem.dir}/gems/#{Webapidoc::NAME}-#{Webapidoc::VERSION}/lib/#{Webapidoc::NAME}",
7
- "#{File.dirname(__FILE__)}"
8
- ]
9
- t.each {|i| return i if File.readable?(i) }
10
- raise "paths are invalid: #{t}"
11
- end
4
+ @@docDir = "app/documentation"
5
+ @@publicDir = "public/documentation"
6
+ @@configFile = 'config/webapidoc.yml'
7
+
8
+ def self.partial(template)
9
+ # rails like _ templates, simple injection
10
+ template = template.to_s.split('/')
11
+ template[ template.length - 1 ] = '_' + template[ template.length - 1 ]
12
+ template = template.join('/')
13
+ inFile = @@docDir + "/" + template + ".md"
14
+
15
+ if !File.exists?(inFile)
16
+ inFile = inFile + ".erb"
17
+ end
12
18
 
13
- def self.build
19
+ if !File.exists?(inFile)
20
+ puts "partial not found: #{inFile}"
21
+ return
22
+ end
23
+
24
+ # read partials contents and inject it
25
+ File.open(inFile, 'r').read
26
+ end
14
27
 
15
- publicDir = "public/documentation"
16
- docDir = "app/documentation"
17
- libDir = gem_libdir
28
+ def self.libDir
29
+ File.dirname(__FILE__)
30
+ end
18
31
 
32
+ def self.build
19
33
  # get config hash
20
- configFile = 'config/webapidoc.yml'
21
- @data = YAML.load_file(configFile).freeze
34
+ @data = YAML.load_file(@@configFile).freeze
22
35
 
23
36
  puts "building webapidoc for " + @data["title"]
24
- puts "api url: " + @data["url"]
37
+ puts "api url: " + @data["url"] if @data["url"]
25
38
 
26
39
  # clean up
27
- FileUtils.remove_dir publicDir if File.exists?(publicDir)
40
+ FileUtils.remove_dir @@publicDir if File.exists?(@@publicDir)
28
41
 
29
- # create paths
30
- FileUtils.mkdir_p publicDir
31
- FileUtils.mkdir publicDir + "/css"
32
- FileUtils.mkdir publicDir + "/js"
42
+ # create @s
43
+ FileUtils.mkdir_p @@publicDir
44
+ FileUtils.mkdir @@publicDir + "/css"
33
45
 
34
- # copy jquery
35
- FileUtils.copy(libDir + "/js/jquery.js", publicDir + "/js/jquery.js")
36
-
37
- # copy highlight
38
- FileUtils.copy(libDir + "/js/highlight.js", publicDir + "/js/highlight.js")
46
+ # copy javascripts
47
+ FileUtils.cp_r(libDir + "/js", @@publicDir + "/js")
39
48
 
40
49
  # compile webapidoc style
41
50
  sass_filename = libDir + "/css/webapidoc.scss"
42
51
  css = Sass::Engine.for_file(sass_filename, {:style => :compressed}).render
43
- File.open(publicDir + "/css/webapidoc.css", "wb") {|f| f.write(css) }
44
-
45
- # parse chapters and create html from md
46
- @chapters = []
52
+ File.open(@@publicDir + "/css/webapidoc.css", "wb") {|f| f.write(css) }
47
53
 
48
- # get chapter info
49
- @data["chapters"].each_with_index do | chapter, idx|
54
+ # open index file
55
+ inFile = "#{@@docDir}/documentation.md"
56
+ # look for erb
57
+ if !File.exists?(inFile)
58
+ inFile = inFile + ".erb"
59
+ end
60
+ # not found?
61
+ if !File.exists?(inFile)
62
+ puts "documentation not found: #{inFile}"
63
+ exit 0
64
+ end
50
65
 
51
- inFile = "#{docDir}/#{chapter["file"]}.md"
52
- outFile = chapter["file"] + ".html"
66
+ # open file
67
+ contents = ERB.new(File.open(inFile, 'r').read).result(binding)
68
+ maruku = Maruku.new(contents)
53
69
 
54
- if File.exists?(inFile + ".erb" )
55
- inFile = inFile + ".erb"
56
- end
70
+ # build html
71
+ html = Nokogiri::HTML(maruku.to_html)
57
72
 
58
- if File.exists?(inFile)
59
- contents = File.open(inFile, 'r').read
60
- else
61
- puts "file not found: #{inFile}"
62
- next
73
+ # build chapters
74
+ @chapters = []
75
+ @chapters = html.xpath('//body').children.inject([]) do |chapters_hash, child|
76
+ # build chapter
77
+ if child.name == 'h1'
78
+ title = child.inner_text
79
+ anchor = title.downcase.gsub(/[^\d\w\s]/, "").tr(" ", "_")
80
+ chapters_hash << { :title => title, :contents => '', :file => anchor}
63
81
  end
64
82
 
65
- @chapters << { :name => chapter["name"], :out => outFile, :in => inFile}
83
+ next chapters_hash if chapters_hash.empty?
84
+ chapters_hash.last[:contents] << child.to_xhtml
85
+ chapters_hash
66
86
  end
67
87
 
68
- @chapters.each_with_index do | chapter, idx|
69
-
70
- contents = ERB.new(File.open(chapter[:in], 'r').read).result(binding)
71
- maruku = Maruku.new(contents)
72
-
73
- # get content info for subsections ( side pane navigation )
74
- sections = []
75
- maruku.each_element(:header) do | el |
76
- next unless el.meta_priv[:level] == 2 or el.meta_priv[:level] == 3
77
- sections << {:title => el.children[0], :level => el.meta_priv[:level]}
88
+ # build sections
89
+ @sections = []
90
+ cidx = -1
91
+ html.xpath('//body').children.inject([]) do |chapters_hash, child|
92
+ # store sections for navigation
93
+ if child.name == 'h1' or child.name == 'h2' or child.name == 'h3'
94
+ title = child.inner_text
95
+ anchor = title.downcase.gsub(/[^\d\w\s]/, "").tr(" ", "_")
96
+ level = child.name[-1, 1]
97
+ cidx = cidx + 1 if level == "1"
98
+ next unless @chapters[cidx].present?
99
+ file = @chapters[cidx][:file]
100
+ @sections << {:title => title, :file => file, :anchor => anchor, :level => level}
78
101
  end
79
-
80
- chapter[:html] = maruku.to_html
81
- chapter[:sections] = sections
82
-
83
102
  end
84
103
 
85
104
  # open template
86
105
  template = "#{libDir}/template.html.erb"
87
106
 
88
- # build chapter files
89
- @chapters.each do | chapter |
90
-
91
- # bindings
92
- @html = chapter[:html]
93
- @current = chapter
94
- puts "building #{chapter[:name]}"
107
+ # write each chapter to file
108
+ @chapters.each_with_index do | chapter, idx |
109
+ outFile = "#{@@publicDir}/#{chapter[:file]}.html"
110
+ puts idx.to_s + ":" + chapter[:title] + " > " + outFile
111
+ # convert md to html
112
+ @html = chapter[:contents]
95
113
  # write it
96
- File.open("#{publicDir}/#{chapter[:out]}", 'w') { |file| file.write(ERB.new(File.open(template, 'r').read).result(binding)) }
114
+ File.open(outFile, 'w') { |file| file.write(ERB.new(File.open(template, 'r').read).result(binding)) }
97
115
  end
98
116
  end
99
- end
117
+ end
@@ -49,9 +49,28 @@ blockquote, q {
49
49
  quotes: none; }
50
50
 
51
51
  blockquote {
52
+
53
+ font-family: serif;
54
+ font-style: italic;
55
+ margin: 0.25em 0;
56
+ padding: 0.25em 40px;
57
+ line-height: 1.45;
58
+ position: relative;
59
+
52
60
  &:before, &:after {
53
61
  content: '';
54
- content: none; } }
62
+ content: none; }
63
+
64
+ &:before {
65
+ display: block;
66
+ content: "\201C";
67
+ font-size: 56px;
68
+ position: absolute;
69
+ left: 0px;
70
+ top: 0px;
71
+ color: #7a7a7a;
72
+ }
73
+ }
55
74
 
56
75
  q {
57
76
  &:before, &:after {
@@ -131,7 +150,7 @@ pre {
131
150
 
132
151
  body {
133
152
 
134
- font-family: "Lato", Calibri, Arial, sans-serif;
153
+ font-family: sans-serif;
135
154
  font-weight: 300;
136
155
  color: $color-text;
137
156
 
@@ -323,13 +342,14 @@ h1
323
342
  font-size: 21pt;
324
343
  margin-top: 38px;
325
344
  color: $color;
345
+ padding-bottom:4px;
346
+ border-bottom: 1px solid #ddd;
326
347
  }
327
348
 
328
349
  h2 {
329
350
  font-size: 18pt;
330
351
  margin-top: 28px;
331
- padding-bottom:4px;
332
- border-bottom: 1px solid #ddd;
352
+ font-weight: 400;
333
353
  }
334
354
 
335
355
  h3 {
@@ -420,56 +440,63 @@ ul {
420
440
 
421
441
  /* #Navigation Styles
422
442
  ================================================== */
443
+ #nav {
444
+ div.title {
445
+ text-align:right;
446
+ margin-top: 24px;
447
+ margin-bottom: 12px;
448
+ font-size:26px;
449
+ line-height:1.4;
450
+ opacity: 0.3;
451
+ font-weight: 300;
452
+ color: $color;
423
453
 
424
- ul.nav-list {
425
-
426
- list-style-type: none;
427
-
428
- margin: 0;
429
- margin-top: 42px;
430
- text-align: right;
431
-
432
- > li {
454
+ }
455
+ ul.nav-list {
433
456
 
434
- padding: 4px 0px;
457
+ list-style-type: none;
435
458
 
436
- > a {
437
- text-decoration: none;
438
- color: $color-text;
439
- &:hover {
440
- color: $color-highlight;
441
- }
442
- }
459
+ margin: 0;
460
+ margin-top: 42px;
461
+ text-align: right;
443
462
 
444
- &.nav-header {
463
+ > li {
445
464
 
446
- font-size: 16px;
447
- margin-top: 12px;
448
- border-bottom: 1px solid #ddd;
465
+ padding: 3px 0px;
449
466
 
450
467
  > a {
451
- color: $color;
452
- }
453
-
454
- &:hover {
455
-
468
+ text-decoration: none;
469
+ color: $color-text;
470
+ &:hover {
471
+ color: $color-highlight;
472
+ }
456
473
  }
457
474
 
458
- &.active {
475
+ &.nav-item {
459
476
 
460
- }
461
- }
477
+ &.level1 {
478
+ font-size: 20px;
479
+ font-weight: 400;
480
+ padding-top:16px;
481
+ border-bottom: 1px solid #ddd;
462
482
 
463
- &.nav-item {
483
+ > a {color: $color;}
484
+ }
464
485
 
465
- font-size: 13px;
486
+ &.level2 {
487
+ font-size: 16px;
488
+ font-weight: 400;
489
+ padding-top:12px;
490
+ }
466
491
 
467
- &.level2 {
468
- font-weight: 700;
469
- padding-top:8px;
470
- }
471
- &:hover {
492
+ &.level3 {
493
+ font-size: 14px;
494
+ font-weight: 300;
495
+ padding-top:12px;
496
+ }
497
+ &:hover {
472
498
 
499
+ }
473
500
  }
474
501
  }
475
502
  }
@@ -497,8 +524,11 @@ code {
497
524
  padding: 2px;
498
525
  padding-left:4px;
499
526
  padding-right:4px;
500
- }
501
527
 
528
+ }
529
+ pre > code {
530
+ display: block;
531
+ }
502
532
  /* editor */
503
533
  .ace_editor {
504
534
  width: 100%;
@@ -600,9 +630,16 @@ pre.response {
600
630
  text-shadow: none;
601
631
  line-height: 20px;
602
632
 
603
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;
633
+ font-family: monospace;
604
634
  font-size: 12px;
605
635
 
636
+ > a {
637
+ color: $color-text;
638
+ &:hover {
639
+ color: $color-highlight;
640
+ }
641
+ }
642
+
606
643
  }
607
644
  .coffeescript .javascript, .javascript .xml, .tex .formula {
608
645
  opacity: 0.5;
@@ -668,4 +705,4 @@ only screen and ( min-device-pixel-ratio: 2),
668
705
  only screen and ( min-resolution: 192dpi),
669
706
  only screen and ( min-resolution: 2dppx) {
670
707
  /* TODO */
671
- }
708
+ }
@@ -0,0 +1,42 @@
1
+ /*!
2
+ Lo-Dash 0.10.0 lodash.com/license
3
+ Underscore.js 1.4.2 underscorejs.org/LICENSE
4
+ */
5
+ ;(function(e,t){function s(t,r){var i,s=e.onerror,o=e._,u=et.createElement("script"),a=et.scripts[0];e.onerror=function(e){return i=e,n},u.text="var _=function("+t+"){"+r+"\n}",a.parentNode.insertBefore(u,a).parentNode.removeChild(u),u=e._,e._=o,e.onerror=s;if(i)throw new SyntaxError(i);return u}function o(e){if(e&&"object"==typeof e&&e.__wrapped__)return e;if(!(this instanceof o))return new o(e);this.__wrapped__=e}function u(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||ot);if(i)for(var s={},n=t-1;++
6
+ n<r;){var o=e[n]+"";(Ct.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return Ct.call(s,r)&&-1<W(s[r],n)}return-1<W(e,n,t)}}function a(e){return e.charCodeAt(0)}function f(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||"undefined"==typeof e)return 1;if(e<t||"undefined"==typeof t)return-1}return n<r?-1:1}function l(e,t,n){function i(){var r=arguments,a=o?this:t;return s||(e=t[u]),n.length&&(r=r.length?n.concat(g(r)):n),this instanceof i?(r=e.apply(this,r),k(r)?r:this):e
7
+ .apply(a,r)}var s=C(e),o=!n,u=t;return o&&(n=t),s||(t=e),e&&e.prototype&&(m.prototype=e.prototype,i.prototype=new m,m.prototype=r),i}function c(e,t){return e?"function"!=typeof e?function(t){return t[e]}:"undefined"!=typeof t?function(n,r,i){return e.call(t,n,r,i)}:e:K}function h(){for(var e={b:"",c:"",e:Vt,f:tn,g:"",h:Kt,i:Gt,j:Et,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e.d=/^[^,]+/.exec(t)[0],r="var i,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){"
8
+ ,e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){"+e.b+"}}else {"):e.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){i+='';"+e.g+"}}else {"),e.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');");if(e.f&&e.l)r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",e.e||(r+="if(!(u&&i=='prototype')){"),r+=e.g+"",e.e||(r+="}");else{r+="for(i in l){";if(!e.e||e.l)r+="if(",e.e||(r+="!(u&&i=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="h.call(l,i)"),r+="){";r+=e.g+";";if(!
9
+ e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=l.constructor;";for(i=0;7>i;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t",s("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(c,Ct,b,A,sn,Pt,Lt)}function p(e){return"\\"+on[e]}function d(e){return dn[e]}function v(e){return"function"!=typeof e.toString&&"string"==typeof (e+"")}function m(){}function g(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length
10
+ :0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function y(e){return vn[e]}function b(e){return At.call(e)==Ft}function w(e){var t=i;if(!e||"object"!=typeof e||b(e))return t;var n=e.constructor;return!C(n)&&(!Yt||!v(e))||n instanceof n?$t?(hn(e,function(e,n,r){return t=!Ct.call(r,n),i}),t===i):(hn(e,function(e,n){t=n}),t===i||Ct.call(e,t)):t}function E(e){var t=[];return pn(e,function(e,n){t.push(n)}),t}function S(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=k(e)){var u=At.call
11
+ (e);if(!nn[u]||Yt&&v(e))return e;var a=gn(e)}if(!n||!t)return n?a?g(e):cn({},e):e;n=rn[u];switch(u){case qt:case Rt:return new n(+e);case Ut:case Xt:return new n(e);case Wt:return n(e.source,pt.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?wn:pn)(e,function(e,n){f[n]=S(e,t,r,s,o)}),a&&(Ct.call(e,"index")&&(f.index=e.index),Ct.call(e,"input")&&(f.input=e.input)),f}function x(e){var t=[];return hn(e,function(e,n){C(e)&&t
12
+ .push(n)}),t.sort()}function T(e){var t={};return pn(e,function(e,n){t[e]=n}),t}function N(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=At.call(e),a=At.call(t);u==Ft&&(u=zt),a==Ft&&(a=zt);if(u!=a)return i;switch(u){case qt:case Rt:return+e==+t;case Ut:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Wt:case Xt:return e==t+""}a=u==It;if(!a){if(e.__wrapped__||t.__wrapped__)return N(e.__wrapped__||e,t.__wrapped__||t);if(u!=zt||Yt&&(v(e)||v(t)))return i;var u=e.constructor,f=t
13
+ .constructor;if(u!=f&&(!C(u)||!(u instanceof u&&C(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var l=n,c=0;s.push(e),o.push(t);if(a){c=e.length;if(l=c==t.length)for(;c--&&(l=N(e[c],t[c],s,o)););return l}return hn(e,function(e,n,r){if(Ct.call(r,n))return c++,l=Ct.call(t,n)&&N(e,t[n],s,o)}),l&&hn(t,function(e,t,n){if(Ct.call(n,t))return l=-1<--c}),l}function C(e){return"function"==typeof e}function k(e){return e?sn[typeof e]:i}function L(e){return"number"==typeof
14
+ e||At.call(e)==Ut}function A(e){return"string"==typeof e||At.call(e)==Xt}function O(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==st&&(u=[],a=[],"number"!=typeof n&&(o=i.length));for(;++s<o;)pn(i[s],function(t,n){var i,s,o;if(t&&((s=gn(t))||yn(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?gn(o)?o:[]:yn(o)?o:{}),e[n]=O(o,t,st,u,a))}else t!=r&&(e[n]=t)});return e}function M(e){var t=[];return pn(e,function(e){t.push(e)}),t}function _(e,t,n){var r=-1,s=
15
+ e?e.length:0,o=i,n=(0>n?Ht(0,s+n):n)||0;return"number"==typeof s?o=-1<(A(e)?e.indexOf(t,n):W(e,t,n)):wn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function D(e,t,r){var i=n,t=c(t,r);if(gn(e))for(var r=-1,s=e.length;++r<s&&(i=!!t(e[r],r,e)););else wn(e,function(e,n,r){return i=!!t(e,n,r)});return i}function P(e,t,n){var r=[],t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i;){var s=e[n];t(s,n,e)&&r.push(s)}else wn(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function H(e,t,n){var r,t=c(t,n);return wn
16
+ (e,function(e,n,s){if(t(e,n,s))return r=e,i}),r}function B(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=c(t,n);if(gn(e))for(;++r<i;)s[r]=t(e[r],r,e);else wn(e,function(e,n,i){s[++r]=t(e,n,i)});return s}function j(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,o=e)});else for(;++i<s;)e[i]>o&&(o=e[i]);return o}function F(e,t){return B(e,t+"")}function I(e,t,n,r){var s=3>arguments.length;return t||(t=K),wn
17
+ (e,function(e,o,u){n=s?(s=i,e):t.call(r,n,e,o,u)}),n}function q(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=bn(e),o=a.length;else Gt&&A(e)&&(s=e.split(""));return t||(t=K),wn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function R(e,t,n){var r,t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else wn(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function U(e,t,n){if(e){var i=e.length;return t==r||n?e[0]:g(e,0,Bt
18
+ (Ht(0,t),i))}}function z(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];gn(s)?kt.apply(i,t?s:z(s)):i.push(s)}return i}function W(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?Ht(0,i+n):n||0)-1;else if(n)return r=V(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function X(e,t,n){return g(e,t==r||n?1:Ht(0,t))}function V(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?c(n,r):K,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function $(e,t,n,r){var s=-1,o=e?e.length:0
19
+ ,u=[],a=u;"function"==typeof t&&(r=n,n=t,t=i);var f=!t&&74<o;if(f)var l={};n&&(a=[],n=c(n,r));for(;++s<o;){var r=e[s],h=n?n(r,s,e):r;f&&(a=Ct.call(l,h+"")?l[h]:l[h]=[]);if(t?!s||a[a.length-1]!==h:0>W(a,h))(n||f)&&a.push(h),u.push(r)}return u}function J(e,t){return en||Ot&&2<arguments.length?Ot.call.apply(Ot,arguments):l(e,t,g(arguments,2))}function K(e){return e}function Q(e){wn(x(e),function(t){var n=o[t]=e[t];o.prototype[t]=function(){var e=[this.__wrapped__];return kt.apply(e,arguments),e=n.apply
20
+ (o,e),new o(e)}})}function G(){return this.__wrapped__}var n=!0,r=null,i=!1,Y="object"==typeof exports&&exports,Z="object"==typeof global&&global;Z.global===Z&&(e=Z);try{var et=e.document}catch(tt){}var nt=[],rt=new function(){},it=0,st=rt,ot=30,ut=e._,at=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ft=/&(?:amp|lt|gt|quot|#x27);/g,lt=/\b__p\+='';/g,ct=/\b(__p\+=)''\+/g,ht=/(__e\(.*?\)|\b__t\))\+'';/g,pt=/\w*$/,dt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,vt=RegExp("^"+(rt
21
+ .valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),mt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,gt=/<%=([\s\S]+?)%>/g,yt=/($^)/,bt=/[&<>"']/g,wt=/['\n\r\t\u2028\u2029\\]/g,Et="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),St=Math.ceil,xt=nt.concat,Tt=Math.floor,Nt=vt.test(Nt=Object.getPrototypeOf)&&Nt,Ct=rt.hasOwnProperty,kt=nt.push,Lt=rt.propertyIsEnumerable,At=rt.toString,Ot=vt.test(Ot=g.bind)&&Ot,
22
+ Mt=vt.test(Mt=Array.isArray)&&Mt,_t=e.isFinite,Dt=e.isNaN,Pt=vt.test(Pt=Object.keys)&&Pt,Ht=Math.max,Bt=Math.min,jt=Math.random,Ft="[object Arguments]",It="[object Array]",qt="[object Boolean]",Rt="[object Date]",Ut="[object Number]",zt="[object Object]",Wt="[object RegExp]",Xt="[object String]",Vt,$t,Jt=(Jt={0:1,length:1},nt.splice.call(Jt,0,1),Jt[0]),Kt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Kt=!n;Vt=!/valueOf/.test
23
+ (t),$t="x"!=t[0]})(1);var Qt=!b(arguments),Gt="xx"!="x"[0]+Object("x")[0];try{var Yt=("[object Object]",At.call(et||0)==zt)}catch(Zt){}var en=Ot&&/\n|Opera/.test(Ot+At.call(e.opera)),tn=Pt&&/^.+$|true/.test(Pt+!!e.attachEvent),nn={"[object Function]":i};nn[Ft]=nn[It]=nn[qt]=nn[Rt]=nn[Ut]=nn[zt]=nn[Wt]=nn[Xt]=n;var rn={};rn[It]=Array,rn[qt]=Boolean,rn[Rt]=Date,rn[zt]=Object,rn[Ut]=Number,rn[Wt]=RegExp,rn[Xt]=String;var sn={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},on={"\\"
24
+ :"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:gt,variable:""};try{(/1/.test(function(){1})||s)()}catch(un){s=Function}var an={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a<b;a++){if((l=arguments[a])){",g:"t[i]=l[i]",c:"}}"},fn={a:"d,c,w",k:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"if(c(l[i],i,d)===false)return t",g:"if(c(l[i],i,d)===false)return t"},ln={b:r},cn=h(an
25
+ );Qt&&(b=function(e){return e?Ct.call(e,"callee"):i});var hn=h(fn,ln,{l:i}),pn=h(fn,ln),dn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},vn=T(dn),mn=h(an,{g:"if(t[i]==null)"+an.g}),gn=Mt||function(e){return At.call(e)==It};C(/x/)&&(C=function(e){return"[object Function]"==At.call(e)});var yn=Nt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=Nt(t))&&Nt(n);return n?e==n||Nt(e)==n&&!b(e):w(e)}:w,bn=Pt?function(e){return"function"==typeof e&&
26
+ Lt.call(e,"prototype")?E(e):k(e)?Pt(e):[]}:E,wn=h(fn);o.VERSION="0.10.0",o.assign=cn,o.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},o.bind=J,o.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=x(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=J(e[i],e)}return e},o.bindKey=function(e,t){return l(e,t,g(arguments,2))},o.chain=function(e){return new o(e)},o.clone=S,o.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r
27
+ },o.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},o.contains=_,o.countBy=function(e,t,n){var r={},t=c(t,n);return wn(e,function(e,n,i){n=t(e,n,i),Ct.call(r,n)?r[n]++:r[n]=1}),r},o.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},o.defaults=mn,o.defer=function(e){var n=g(arguments,1
28
+ );return setTimeout(function(){e.apply(t,n)},1)},o.delay=function(e,n){var r=g(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},o.difference=function(e){for(var t=-1,n=e?e.length:0,r=xt.apply(nt,arguments),r=u(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},o.escape=function(e){return e==r?"":(e+"").replace(bt,d)},o.every=D,o.filter=P,o.find=H,o.first=U,o.flatten=z,o.forEach=wn,o.forIn=hn,o.forOwn=pn,o.functions=x,o.groupBy=function(e,t,n){var r={},t=c(t,n);return wn(e,function(
29
+ e,n,i){n=t(e,n,i),(Ct.call(r,n)?r[n]:r[n]=[]).push(e)}),r},o.has=function(e,t){return e?Ct.call(e,t):i},o.identity=K,o.indexOf=W,o.initial=function(e,t,n){if(!e)return[];var i=e.length;return g(e,0,Bt(Ht(0,i-(t==r||n?1:t||0)),i))},o.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return wn(e,function(e){if(0>W(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=u(t[s])))(e))return;i.push(e)}}),i},o.invert=T,o.invoke=function(e,t){var n=g(arguments,2),r="function"==typeof t,i=[];return wn(e,function(
30
+ e){i.push((r?t:e[t]).apply(e,n))}),i},o.isArguments=b,o.isArray=gn,o.isBoolean=function(e){return e===n||e===i||At.call(e)==qt},o.isDate=function(e){return At.call(e)==Rt},o.isElement=function(e){return e?1===e.nodeType:i},o.isEmpty=function(e){var t=n;if(!e)return t;var r=At.call(e),s=e.length;return r==It||r==Xt||r==Ft||Qt&&b(e)||r==zt&&"number"==typeof s&&C(e.splice)?!s:(pn(e,function(){return t=i}),t)},o.isEqual=N,o.isFinite=function(e){return _t(e)&&!Dt(parseFloat(e))},o.isFunction=C,o.isNaN=
31
+ function(e){return L(e)&&e!=+e},o.isNull=function(e){return e===r},o.isNumber=L,o.isObject=k,o.isPlainObject=yn,o.isRegExp=function(e){return At.call(e)==Wt},o.isString=A,o.isUndefined=function(e){return"undefined"==typeof e},o.keys=bn,o.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:g(e,Ht(0,i-t))}},o.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Ht(0,r+n):Bt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},o.map=B,o.max=j,o.memoize=function(e,t){var n=
32
+ {};return function(){var r=t?t.apply(this,arguments):arguments[0];return Ct.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},o.merge=O,o.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,o=e)});else for(;++i<s;)e[i]<o&&(o=e[i]);return o},o.mixin=Q,o.noConflict=function(){return e._=ut,this},o.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},o.omit=function(e,
33
+ t,n){var r="function"==typeof t,i={};if(r)t=c(t,n);else var s=xt.apply(nt,arguments);return hn(e,function(e,n,o){if(r?!t(e,n,o):0>W(s,n,1))i[n]=e}),i},o.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},o.pairs=function(e){var t=[];return pn(e,function(e,n){t.push([n,e])}),t},o.partial=function(e){return l(e,g(arguments,1))},o.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=xt.apply(nt,arguments),o=s.length;++i<o;){var u=s[i];u in
34
+ e&&(r[u]=e[u])}else t=c(t,n),hn(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},o.pluck=F,o.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+Tt(jt()*((+t||0)-e+1))},o.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=Ht(0,St((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},o.reduce=I,o.reduceRight=q,o.reject=function(e,t,n){return t=c(t,n),P(e,function(e,n,r){return!t(e,n,r)})},o.rest=X,o.result=function(e,t){var n=e?e[t]:r;return C(n)?e[t]():n},o.shuffle=
35
+ function(e){var t=-1,n=Array(e?e.length:0);return wn(e,function(e){var r=Tt(jt()*(++t+1));n[t]=n[r],n[r]=e}),n},o.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:bn(e).length},o.some=R,o.sortBy=function(e,t,n){var r=[],t=c(t,n);wn(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(f);e--;)r[e]=r[e].c;return r},o.sortedIndex=V,o.tap=function(e,t){return t(e),e},o.template=function(e,t,n){e||(e=""),n||(n={});var r,i,u=o.templateSettings,a=0,f=n.interpolate||u.interpolate||
36
+ yt,l="__p+='",c=n.variable||u.variable,h=c;e.replace(RegExp((n.escape||u.escape||yt).source+"|"+f.source+"|"+(f===gt?mt:yt).source+"|"+(n.evaluate||u.evaluate||yt).source+"|$","g"),function(t,n,i,s,o,u){return i||(i=s),l+=e.slice(a,u).replace(wt,p),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),i&&(l+="'+((__t=("+i+"))==null?'':__t)+'"),r||(r=o||at.test(n||i)),a=u+t.length,t}),l+="';\n",h||(c="obj",r?l="with("+c+"){"+l+"}":(n=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(dt,"$&"+c+".").replace
37
+ (n,"$1__d"))),l=(r?l.replace(lt,""):l).replace(ct,"$1").replace(ht,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+c+"."+c+"||"+c)+";")+l+"return __p}";try{i=s("_","return "+l)(o)}catch(d){throw d.source=l,d}return t?i(t):(i.source=l,i)},o.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments
38
+ ,o=this,0>=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},o.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},o.toArray=function(e){return"number"==typeof (e?e.length:0)?Gt&&A(e)?e.split(""):g(e):M(e)},o.unescape=function(e){return e==r?"":(e+"").replace(ft,y)},o.union=function(){return $(xt.apply(nt,arguments))},o.uniq=$,o.uniqueId=function(e){return(e==r?"":e+"")+ ++it},o.values=M,o.where=function(e,t){var n=bn(t);return P(e,function(e){for(
39
+ var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},o.without=function(e){for(var t=-1,n=e?e.length:0,r=u(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},o.wrap=function(e,t){return function(){var n=[e];return kt.apply(n,arguments),t.apply(this,n)}},o.zip=function(e){for(var t=-1,n=e?j(F(arguments,"length")):0,r=Array(n);++t<n;)r[t]=F(arguments,t);return r},o.all=D,o.any=R,o.collect=B,o.detect=H,o.drop=X,o.each=wn,o.extend=cn,o.foldl=I,o.foldr=q,o.head=U,o.include=
40
+ _,o.inject=I,o.methods=x,o.select=P,o.tail=X,o.take=U,o.unique=$,Q(o),o.prototype.chain=function(){return this},o.prototype.toString=function(){return""+this.__wrapped__},o.prototype.value=G,o.prototype.valueOf=G,wn(["first","last"],function(e){var t=o[e];t&&(o.prototype[e]=function(e,n){var i=t(this.__wrapped__,e,n);return e==r||n?i:new o(i)})}),wn(P(x(o),function(e){return/^(?:contains|every|find|has|is[A-Z].+|reduce.*|some)$/.test(e)}),function(e){var t=o[e];o.prototype[e]=function(){var e=[this
41
+ .__wrapped__];return kt.apply(e,arguments),t.apply(o,e)}}),wn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=nt[e];o.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Jt&&e.length===0&&delete e[0],this}}),wn(["concat","join","slice"],function(e){var t=nt[e];o.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new o(e)}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=o,define(function(){return o})):
42
+ Y?"object"==typeof module&&module&&module.exports==Y?(module.exports=o)._=o:Y._=o:e._=o})(this);
@@ -17,9 +17,6 @@
17
17
  </filter>
18
18
  </svg>
19
19
 
20
- <!-- Use a readable font -->
21
- <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
22
-
23
20
  <!-- Le styles -->
24
21
  <link href="/documentation/css/webapidoc.css" rel="stylesheet">
25
22
 
@@ -31,9 +28,12 @@
31
28
  <!-- Les javascripts -->
32
29
  <script src="/documentation/js/jquery.js"></script>
33
30
  <script src="/documentation/js/highlight.js"></script>
31
+ <script src="/documentation/js/lodash.min.js"></script>
34
32
 
35
33
  <!-- Ace Code Editor -->
36
- <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
34
+ <% if @data["url"].present? %>
35
+ <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
36
+ <% end %>
37
37
 
38
38
  <!-- Fav and touch icons -->
39
39
  <link rel="shortcut icon" href="favicon.ico">
@@ -44,20 +44,15 @@
44
44
  <div class="container">
45
45
  <div class="row">
46
46
  <div class="four columns offset-by-one" id="nav">
47
+ <div class="title">
48
+ <%= @data["title"] %> Documentation
49
+ </div>
47
50
  <ul class="nav-list">
48
51
 
49
- <% @chapters.each do |chapter| %>
50
-
51
- <li class="nav-header <%= "active" if chapter[:name] == @current[:name] %>">
52
- <a href="/documentation/<%= chapter[:out] %>"><%= chapter[:name] %></a></li>
53
-
54
- <% chapter[:sections].each do |section| %>
52
+ <% @sections.each do |section| %>
55
53
  <li class="nav-item level<%= section[:level] %>" >
56
- <a href="<%= chapter[:out] %>#<%= section[:title].downcase.gsub(/[^\d\w\s]/, "").tr(" ", "_") %>"><%= section[:title] %></a>
54
+ <a href="/documentation/<%= section[:file]%>.html/#<%= section[:anchor]%>"><%= section[:title] %></a>
57
55
  </li>
58
-
59
- <% end %>
60
-
61
56
  <% end %>
62
57
 
63
58
  </ul>
@@ -83,50 +78,48 @@
83
78
  <script>
84
79
  $(document).ready(function() {
85
80
 
86
- $("#content > pre > code").each( function (idx) {
87
- var $editor = $(this);
88
- var id = "editor" + idx;
89
- var height = $editor.height();
90
81
 
91
- $editor.attr("id", id)
82
+ <% if @data["url"].present? %>
83
+ $("#content > pre > code").each( function (idx) {
84
+ var $editor = $(this);
85
+ var id = "editor" + idx;
86
+ var height = $editor.height();
92
87
 
93
- /* build editor */
94
- var editor = ace.edit(id);
95
- editor.setTheme("ace/theme/tomorrow");
96
- editor.getSession().setMode("ace/mode/javascript");
88
+ $editor.attr("id", id)
97
89
 
98
- $editor.css("height", ((height+8) + "px"));
90
+ /* build editor */
91
+ var editor = ace.edit(id);
92
+ editor.setTheme("ace/theme/tomorrow");
93
+ editor.getSession().setMode("ace/mode/javascript");
99
94
 
100
- /* build response field */
101
- var rid = "response" + idx;
102
- var $response = $('<pre><code>change code to see response...</code></pre>').attr("id", rid).addClass("response");
95
+ $editor.css("height", ((height+8) + "px"));
103
96
 
104
- $editor.after($response);
97
+ /* build response field */
98
+ var rid = "response" + idx;
99
+ var $response = $('<pre><code><a href="#">click here</a> or change code to see response... </code></pre>').attr("id", rid).addClass("response");
105
100
 
106
- /* bind editor change function for api requests */
107
- editor.on("change", function(e) {
108
- console.log(e);
101
+ $editor.after($response);
109
102
 
110
- /* validate json */
111
- var query = "";
103
+ var getResponse = _.throttle(function(e) {
104
+ console.log(e);
112
105
 
113
- try {
114
- query = JSON.stringify($.parseJSON(editor.getValue()));
115
- }
116
- catch (err) {
117
- return;
118
- }
119
- var url = "<%= @data['url'] %>";
120
- $.getJSON(url + '&source=' + encodeURIComponent(query)).complete(function (data) {
106
+ var query = editor.getValue();
107
+ var url = "<%= @data['url'] %>";
121
108
 
109
+ $.getJSON(url + '&source=' + encodeURIComponent(query)).complete(function (data) {
110
+ $response.html("<code>" + data.responseText + "</code>");
111
+ hljs.highlightBlock($response[0]);
112
+ });
122
113
 
123
- $response.html("<code>" + data.responseText + "</code>");
124
- hljs.highlightBlock($response[0]);
125
- });
126
- });
114
+ return false;
115
+ }, 500);
127
116
 
128
- })
117
+ /* bind editor change function for api requests */
118
+ editor.on("change", getResponse);
129
119
 
120
+ $response.find("a").click(getResponse);
121
+ })
122
+ <% end %>
130
123
  });
131
124
 
132
125
  </script>
@@ -1,4 +1,4 @@
1
1
  module Webapidoc
2
2
  NAME = "webapidoc"
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
data/lib/webapidoc.rb CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
3
3
  require 'fileutils'
4
4
  require 'erb'
5
5
  require 'sass'
6
+ require 'nokogiri'
6
7
 
7
8
  require 'webapidoc/version'
8
9
  require 'webapidoc/base'
data/webapidoc.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_dependency('maruku', '>= 0.6.1')
22
22
  s.add_dependency('sass', '>= 3.1.19')
23
+ s.add_dependency('nokogiri', '>= 1.5.5')
23
24
 
24
25
  s.add_development_dependency 'rake'
25
26
 
metadata CHANGED
@@ -1,83 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: webapidoc
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Adrian Fuhrmann
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-12-03 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: maruku
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 0
31
- - 6
32
- - 1
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 0.6.1
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.6.1
30
+ - !ruby/object:Gem::Dependency
37
31
  name: sass
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 3.1.19
38
+ type: :runtime
38
39
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
40
41
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 37
45
- segments:
46
- - 3
47
- - 1
48
- - 19
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
49
45
  version: 3.1.19
46
+ - !ruby/object:Gem::Dependency
47
+ name: nokogiri
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 1.5.5
50
54
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: rake
54
55
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.5.5
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
56
65
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
64
70
  type: :development
65
- version_requirements: *id003
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
66
78
  description: Create a static HTML Documentation for your JSON Web API.
67
79
  email: aliasng@gmail.com
68
80
  executables: []
69
-
70
81
  extensions: []
71
-
72
82
  extra_rdoc_files: []
73
-
74
- files:
83
+ files:
75
84
  - .gitignore
76
85
  - README.md
77
86
  - Rakefile
78
87
  - lib/generators/webapidoc/install_generator.rb
79
- - lib/generators/webapidoc/templates/index.md.erb
80
- - lib/generators/webapidoc/templates/sample.md.erb
88
+ - lib/generators/webapidoc/templates/_partial.md.erb
89
+ - lib/generators/webapidoc/templates/documentation.md.erb
81
90
  - lib/generators/webapidoc/templates/webapidoc.yml
82
91
  - lib/webapidoc.rb
83
92
  - lib/webapidoc/base.rb
@@ -85,41 +94,32 @@ files:
85
94
  - lib/webapidoc/js/highlight.js
86
95
  - lib/webapidoc/js/html5.js
87
96
  - lib/webapidoc/js/jquery.js
97
+ - lib/webapidoc/js/lodash.min.js
88
98
  - lib/webapidoc/template.html.erb
89
99
  - lib/webapidoc/version.rb
90
100
  - webapidoc.gemspec
91
101
  homepage: https://github.com/otty/webapidoc
92
102
  licenses: []
93
-
94
103
  post_install_message:
95
104
  rdoc_options: []
96
-
97
- require_paths:
105
+ require_paths:
98
106
  - lib
99
- required_ruby_version: !ruby/object:Gem::Requirement
107
+ required_ruby_version: !ruby/object:Gem::Requirement
100
108
  none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- hash: 3
105
- segments:
106
- - 0
107
- version: "0"
108
- required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
114
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- hash: 3
114
- segments:
115
- - 0
116
- version: "0"
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
117
119
  requirements: []
118
-
119
120
  rubyforge_project:
120
121
  rubygems_version: 1.8.24
121
122
  signing_key:
122
123
  specification_version: 3
123
124
  summary: Static HTML Documentation for JSON Web APIs.
124
125
  test_files: []
125
-
@@ -1,15 +0,0 @@
1
- <%= @data["title"] %> Documentation
2
- ====================
3
-
4
- Welcome
5
- ---------------------
6
-
7
- Now is the time for all good men to come to
8
- the aid of their country.
9
-
10
-
11
- ### Table of contents
12
-
13
- <% @chapters.each_with_index do |chapter, idx| %>
14
- <%= idx %>. [<%= chapter[:name] %>](/documentation/<%= chapter[:out] %>)
15
- <% end %>
@@ -1,72 +0,0 @@
1
- <%= @data["title"] %> Sample Page
2
- ====================
3
-
4
- Paragraphs
5
- ---------------------
6
-
7
- This is just a regular paragraph. Now is the time for all good men to come to
8
- the aid of [their country](http://www.google.de). Look the link!
9
-
10
- Elements
11
- ---------------------
12
-
13
- The quick brown fox jumped over the lazy
14
- dog's back.
15
-
16
- ### Header 3
17
-
18
- > This is a blockquote.
19
- >
20
- > This is the second paragraph in the blockquote.
21
- >
22
-
23
- This is just an ordered list
24
-
25
- 1. Bird
26
- 2. McHale
27
- 3. Parish
28
-
29
- This is just a unordered list.
30
-
31
- * Bird
32
- * McHale
33
- * Parish
34
-
35
-
36
- Support for ERB
37
- ---------------------
38
-
39
- Table of contents generated via ERB:
40
-
41
- <% @chapters.each_with_index do |chapter, idx| %>
42
- <%= idx %>. [<%= chapter[:name] %>](/documentation/<%= chapter[:out] %>)
43
- <% end %>
44
-
45
- Some code
46
- ---------------------
47
-
48
- This is just some code.
49
-
50
- [
51
- {
52
- "title": "apples",
53
- "count": [12000, 20000],
54
- "description": {"text": "...", "sensitive": false}
55
- },
56
- {
57
- "title": "oranges",
58
- "count": [17500, null],
59
- "description": {"text": "...", "sensitive": false}
60
- }
61
- ]
62
-
63
- This is some `code` within a paragraph. More to come!
64
- This is just some more code.
65
-
66
- [
67
- {
68
- "title": "apples",
69
- "count": [12000, 20000],
70
- "description": {"text": "...", "sensitive": false}
71
- }
72
- ]