mirror of https://github.com/freeCodeCamp/devdocs
parent
d86d788f27
commit
79e574e695
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 61 KiB |
@ -0,0 +1,4 @@
|
|||||||
|
#= require views/pages/base
|
||||||
|
#= require views/pages/underscore
|
||||||
|
|
||||||
|
app.views.RethinkdbPage = app.views.UnderscorePage
|
@ -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
|
||||||
|
© RethinkDB contributors<br>
|
||||||
|
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 175 B |
After Width: | Height: | Size: 271 B |
@ -0,0 +1 @@
|
|||||||
|
http://rethinkdb.com/
|
Loading…
Reference in new issue