Skip to content

Commit 58d2ecd

Browse files
committed
Update and version RethinkDB documentation (2.3.0)
1 parent 8a476ba commit 58d2ecd

5 files changed

Lines changed: 40 additions & 9 deletions

File tree

assets/javascripts/views/pages/javascript.coffee

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ app.views.MongoosePage =
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ class app.views.SimplePage extends app.views.BasePage
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def call
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def get_name
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

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ module Docs
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 @@ class Rethinkdb < UrlScraper
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

0 commit comments

Comments
 (0)