Finish Ramda documentation

pull/344/merge
Thibaut Courouble 9 years ago
parent 38f100fbf3
commit 23d3a0240f

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 100 KiB

@ -1,7 +1,7 @@
[
[
"2016-02-15",
"New documentations: <a href=\"/cakephp/\">CakePHP</a> and <a href=\"/chef/\">Chef</a>"
"New documentations: <a href=\"/cakephp/\">CakePHP</a>, <a href=\"/chef/\">Chef</a> and <a href=\"/ramda/\">Ramda</a>"
], [
"2016-01-31",
"New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>"

@ -27,6 +27,7 @@ app.views.MongoosePage =
app.views.NodePage =
app.views.PhaserPage =
app.views.QPage =
app.views.RamdaPage =
app.views.RethinkdbPage =
app.views.SinonPage =
app.views.UnderscorePage =

@ -1,6 +0,0 @@
#= require views/pages/base
class app.views.RamdaPage extends app.views.BasePage
prepare: ->
@highlightCode @findAll('section > pre:last-child'), 'javascript'
return

@ -64,6 +64,7 @@
'pages/phpunit',
'pages/postgres',
'pages/q',
'pages/ramda',
'pages/rdoc',
'pages/react',
'pages/redis',

@ -125,3 +125,4 @@
._icon-tcl_tk:before { background-position: 0 -10rem; }
._icon-erlang:before { background-position: -1rem -10rem; }
._icon-chef:before { background-position: -2rem -10rem; }
._icon-ramda:before { background-position: -3rem -10rem; @extend %darkIconFix !optional; }

@ -1,33 +1,7 @@
._ramda {
@extend %simple;
code { @extend %code; }
h2 + div > code { @extend %block-label, %label-blue; }
h2 {
small {
font-size: small;
float: right;
}
}
.see a { @extend %label; }
.params {
.type {
font-style: italic;
text-transform: capitalize;
margin-right: 0.35em;
&::before { content: '<'; }
&::after { content: '>'; }
}
.panel-body {
margin-bottom: 1.5em;
.type {
padding: 0 0 0 2em;
}
.description > p {
display: inline-block;
}
}
}
code { @extend %code; }
h3 > small { float: right; }
ul { margin-top: 1em; }
}

@ -14,30 +14,19 @@ module Docs
added_in.parent = title
end
# Prepend links with 'R.'
css('h2 > a.name, .see a').each do |link|
link.content = 'R.' + link.content
end
css('.params').each do |node|
# Remove params expand link
node.inner_html = node.at_css('.details').inner_html
node.prepend_child "<h4>Parameters</h4>"
# Count params
if ul = node.at_css('ul')
ul.name = 'ol'
end
# change param names to <code>
node.css('span.name').each do |n|
n.name = 'code'
n.remove_attribute 'class'
end
# change returns to <h4> to make consistant look with params header
if returns = node.at_css('span.returns')
returns.name = 'h4'
if n = node.at_css('> .panel-body')
n.before(n.at_css('span.returns').tap { |_n| _n.name = 'h4' })
n.replace("<ul><li>#{n.to_html}</li></ul>")
end
end
@ -46,6 +35,32 @@ module Docs
node.content = node.content
end
css('div.see').each do |node|
node.name = 'p'
end
css('.see a').each do |node|
node.replace "<code>#{node.to_html}</code>"
end
css('h2 + div > code:only-child').each do |node|
node.parent.name = 'pre'
node.parent.content = node.content
end
css('.card').each do |node|
node.at_css('h2')['id'] = node['id'] if node['id']
node.before(node.children).remove
end
css('.panel-body', 'div.params', 'div.description', 'h2 > a').each do |node|
node.before(node.children).remove
end
css('h2').each do |node|
node.name = 'h3'
end
doc
end
end

@ -2,11 +2,8 @@ module Docs
class Ramda
class EntriesFilter < Docs::EntriesFilter
def additional_entries
css('ul.toc li').map do |item|
name = item['data-name']
category = item['data-category']
['R.' + name, name, category]
css('ul.toc li').map do |node|
["R.#{node['data-name']}", node['data-name'], node['data-category']]
end
end
end

@ -1,10 +1,8 @@
module Docs
class Ramda < UrlScraper
self.name = 'Ramda'
self.slug = 'ramda'
self.type = 'ramda'
self.release = '0.19.1'
self.base_url = 'http://ramdajs.com/docs'
self.base_url = "http://ramdajs.com/#{release}/docs/"
self.links = {
home: 'http://ramdajs.com/',
code: 'https://github.com/ramda/ramda/'

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

@ -1 +1 @@
https://camo.githubusercontent.com/0b4c12a5daec02b72e6e6879861ac70f75046e65/687474703a2f2f72616d64612e6a637068696c6c697070732e636f6d2f6c6f676f2f72616d646146696c6c65645f323030783233352e706e67
http://ramda.jcphillipps.com/logo/ramdaFilled_200x235.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Loading…
Cancel
Save