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
27app.views.NodePage =27app.views.NodePage =
28app.views.PhaserPage =28app.views.PhaserPage =
29app.views.RamdaPage =29app.views.RamdaPage =
30app.views.RethinkdbPage =
31app.views.SinonPage =30app.views.SinonPage =
32app.views.UnderscorePage =31app.views.UnderscorePage =
33app.views.WebpackPage =32app.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
7 return7 return
8 8
9app.views.MeteorPage =9app.views.MeteorPage =
10app.views.RethinkdbPage =
10app.views.TypescriptPage =11app.views.TypescriptPage =
11app.views.SimplePage12app.views.SimplePage
lib/docs/filters/rethinkdb/clean_html.rb+4−0
@@ -31,6 +31,10 @@ module Docs · 30 unmodified lines
31 node.name = 'h2'31 node.name = 'h2'
32 end32 end
33 33
34 css('pre').each do |node|
35 node['data-language'] = current_url.path[/\A\/api\/(\w+)\//, 1]
36 end
37
34 doc38 doc
35 end39 end
36 end40 end
lib/docs/filters/rethinkdb/entries.rb+2−2
@@ -6,8 +6,8 @@ module Docs · 5 unmodified lines
6 end6 end
7 7
8 def get_type8 def get_type
9 link = at_css('a[href^="https://github.com/rethinkdb/docs/blob/master/api/javascript/"]')9 link = at_css('a[href^="https://github.com/rethinkdb/docs/blob/master/api/"]')
10 dir = link['href'][/javascript\/([^\/]+)/, 1]10 dir = link['href'][/api\/\w+\/([^\/]+)/, 1]
11 dir.titleize.gsub('Rql', 'ReQL').gsub('And', 'and')11 dir.titleize.gsub('Rql', 'ReQL').gsub('And', 'and')
12 end12 end
13 13
lib/docs/scrapers/rethinkdb.rb+33−6
@@ -2,8 +2,7 @@ module Docs · 1 unmodified line
2 class Rethinkdb < UrlScraper2 class Rethinkdb < UrlScraper
3 self.name = 'RethinkDB'3 self.name = 'RethinkDB'
4 self.type = 'rethinkdb'4 self.type = 'rethinkdb'
5 self.release = '2.2.5'5 self.release = '2.3.0'
6 self.base_url = 'https://rethinkdb.com/api/javascript/'
7 self.links = {6 self.links = {
8 home: 'https://rethinkdb.com/',7 home: 'https://rethinkdb.com/',
9 code: 'https://github.com/rethinkdb/rethinkdb'8 code: 'https://github.com/rethinkdb/rethinkdb'
@@ -14,13 +13,41 @@ module Docs · 4 unmodified lines
14 options[:trailing_slash] = false13 options[:trailing_slash] = false
15 options[:container] = '.docs-article'14 options[:container] = '.docs-article'
16 15
17 options[:fix_urls] = ->(url) do
18 url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python)}, 'rethinkdb.com/api/javascript/'
19 end
20
21 options[:attribution] = <<-HTML16 options[:attribution] = <<-HTML
22 &copy; RethinkDB contributors<br>17 &copy; RethinkDB contributors<br>
23 Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.18 Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
24 HTML19 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
25 end52 end
26end53end