History

Update and version RethinkDB documentation (2.3.0)

Thibaut Courouble committed 10 years ago

Commit 58d2ecd1 parent 8a476ba5 files · +40 −9Browse files

Unified · Split

5 files
  1. assets/javascripts/views/pages/javascript.coffee +0 −1
  2. assets/javascripts/views/pages/simple.coffee +1 −0
  3. lib/docs/filters/rethinkdb/clean_html.rb +4 −0
  4. lib/docs/filters/rethinkdb/entries.rb +2 −2
  5. lib/docs/scrapers/rethinkdb.rb +33 −6
assets/javascripts/views/pages/javascript.coffee+0−1
@@ -27,7 +27,6 @@ app.views.MongoosePage = · 26 unmodified lines
2727 app.views.NodePage =
2828 app.views.PhaserPage =
2929 app.views.RamdaPage =
30−app.views.RethinkdbPage =
3130 app.views.SinonPage =
3231 app.views.UnderscorePage =
3332 app.views.WebpackPage =
assets/javascripts/views/pages/simple.coffee+1−0
@@ -7,5 +7,6 @@ class app.views.SimplePage extends app.views.BasePage · 6 unmodified lines
77 return
88
99 app.views.MeteorPage =
10+app.views.RethinkdbPage =
1011 app.views.TypescriptPage =
1112 app.views.SimplePage
lib/docs/filters/rethinkdb/clean_html.rb+4−0
@@ -31,6 +31,10 @@ module Docs · 30 unmodified lines
3131 node.name = 'h2'
3232 end
3333
34+ css('pre').each do |node|
35+ node['data-language'] = current_url.path[/\A\/api\/(\w+)\//, 1]
36+ end
37+
3438 doc
3539 end
3640 end
lib/docs/filters/rethinkdb/entries.rb+2−2
@@ -6,8 +6,8 @@ module Docs · 5 unmodified lines
66 end
77
88 def get_type
9− link = at_css('a[href^="https://github.com/rethinkdb/docs/blob/master/api/javascript/"]')
10− dir = link['href'][/javascript\/([^\/]+)/, 1]
9+ link = at_css('a[href^="https://github.com/rethinkdb/docs/blob/master/api/"]')
10+ dir = link['href'][/api\/\w+\/([^\/]+)/, 1]
1111 dir.titleize.gsub('Rql', 'ReQL').gsub('And', 'and')
1212 end
1313
lib/docs/scrapers/rethinkdb.rb+33−6
@@ -2,8 +2,7 @@ module Docs · 1 unmodified line
22 class Rethinkdb < UrlScraper
33 self.name = 'RethinkDB'
44 self.type = 'rethinkdb'
5− self.release = '2.2.5'
6− self.base_url = 'https://rethinkdb.com/api/javascript/'
5+ self.release = '2.3.0'
76 self.links = {
87 home: 'https://rethinkdb.com/',
98 code: 'https://github.com/rethinkdb/rethinkdb'
@@ -14,13 +13,41 @@ module Docs · 4 unmodified lines
1413 options[:trailing_slash] = false
1514 options[:container] = '.docs-article'
1615
17− options[:fix_urls] = ->(url) do
18− url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python)}, 'rethinkdb.com/api/javascript/'
19− end
20−
2116 options[:attribution] = <<-HTML
2217 &copy; RethinkDB contributors<br>
2318 Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
2419 HTML
20+
21+ version 'JavaScript' do
22+ self.base_url = 'https://rethinkdb.com/api/javascript/'
23+
24+ options[:fix_urls] = ->(url) do
25+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/javascript/'
26+ end
27+ end
28+
29+ version 'Ruby' do
30+ self.base_url = 'https://rethinkdb.com/api/ruby/'
31+
32+ options[:fix_urls] = ->(url) do
33+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/ruby/'
34+ end
35+ end
36+
37+ version 'Python' do
38+ self.base_url = 'https://rethinkdb.com/api/python/'
39+
40+ options[:fix_urls] = ->(url) do
41+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/python/'
42+ end
43+ end
44+
45+ version 'Java' do
46+ self.base_url = 'https://rethinkdb.com/api/java/'
47+
48+ options[:fix_urls] = ->(url) do
49+ url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python|java)}, 'rethinkdb.com/api/java/'
50+ end
51+ end
2552 end
2653 end