Add RethinkDB documentation

pull/165/head
Thibaut 10 years ago
parent d86d788f27
commit 79e574e695

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 61 KiB

@ -1,5 +1,8 @@
[
[ "2014-11-30",
[ "2014-12-20",
"New <a href=\"/rethinkdb/\">RethinkDB</a> documentation"
], [
"2014-11-30",
"New <a href=\"/phpunit/\">PHPUnit</a> and <a href=\"/nokogiri/\">Nokogiri</a> documentations"
], [
"2014-11-16",

@ -263,6 +263,11 @@ credits = [
'2010-2014 The Dojo Foundation',
'MIT',
'https://raw.githubusercontent.com/jrburke/requirejs/master/LICENSE'
], [
'RethinkDB',
'RethinkDB contributors',
'CC BY-SA',
'https://raw.githubusercontent.com/rethinkdb/docs/master/LICENSE'
], [
'Ruby',
'1993-2014 Yukihiro Matsumoto',

@ -0,0 +1,4 @@
#= require views/pages/base
#= require views/pages/underscore
app.views.RethinkdbPage = app.views.UnderscorePage

@ -59,6 +59,7 @@
'pages/rdoc',
'pages/redis',
'pages/requirejs',
'pages/rethinkdb',
'pages/rfc',
'pages/sinon',
'pages/sphinx',

@ -4,7 +4,7 @@
width: 1rem;
height: 1rem;
background-image: image-url('icons.png');
background-size: 5rem 12rem;
background-size: 5rem 13rem;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
@ -72,3 +72,4 @@
._icon-mongoose:before { background-position: -2rem -11rem; }
._icon-phpunit:before { background-position: -3rem -11rem; }
._icon-nokogiri:before { background-position: -4rem -11rem; }
._icon-rethinkdb:before { background-position: 0 -12rem; }

@ -0,0 +1,9 @@
._rethinkdb {
> h2 { @extend %block-heading; }
code { @extend %label; }
.api_command_illustration {
float: right;
margin: 0 0 1em 1em;
}
}

@ -0,0 +1,38 @@
module Docs
class Rethinkdb
class CleanHtmlFilter < Filter
def call
if root_page?
doc.inner_html = '<h1>ReQL command reference</h1>'
return doc
end
css('#api-header').each do |node|
node.replace(node.at_css('h1'))
end
css('.linksbox-container').remove
css('.highlight').each do |node|
node.before(node.children).remove
end
css('.command-body').each do |node|
node.name = 'pre'
node.inner_html = node.inner_html.gsub('</p>', "</p>\n")
end
css('pre').each do |node|
node.content = node.content
end
css('h1').each do |node|
next if node['class'].to_s.include?('title')
node.name = 'h2'
end
doc
end
end
end
end

@ -0,0 +1,15 @@
module Docs
class Rethinkdb
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('.title').content.remove('ReQL command:')
end
def get_type
link = at_css('a[href^="https://github.com/rethinkdb/docs/blob/master/api/javascript/"]')
dir = link['href'][/javascript\/([^\/]+)/, 1]
dir.titleize.gsub('Rql', 'ReQL').gsub('And', 'and')
end
end
end
end

@ -0,0 +1,22 @@
module Docs
class Rethinkdb < UrlScraper
self.name = 'RethinkDB'
self.type = 'rethinkdb'
self.version = '1.15.2'
self.base_url = 'http://rethinkdb.com/api/javascript/'
html_filters.push 'rethinkdb/entries', 'rethinkdb/clean_html'
options[:trailing_slash] = false
options[:container] = '.container .section'
options[:fix_urls] = ->(url) do
url.sub! %r{rethinkdb.com/api/(?!javascript|ruby|python)}, 'rethinkdb.com/api/javascript/'
end
options[:attribution] = <<-HTML
&copy; RethinkDB contributors<br>
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

@ -0,0 +1 @@
http://rethinkdb.com/
Loading…
Cancel
Save