add ramda.js

pull/344/merge
Hassan Zamani 9 years ago committed by Thibaut Courouble
parent 1fa82430b0
commit 38f100fbf3

@ -0,0 +1,6 @@
#= 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',

@ -0,0 +1,33 @@
._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;
}
}
}
}

@ -0,0 +1,53 @@
module Docs
class Ramda
class CleanHtmlFilter < Filter
def call
@doc = at_css('main')
# Remove try in repl
css('.try-repl', '.pull-right').remove
# Place 'Added in' in header
css('.card').each do |card|
title = card.at_css('h2')
added_in = card.at_css('small')
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'
end
end
# Remove code highlighting
css('pre').each do |node|
node.content = node.content
end
doc
end
end
end
end

@ -0,0 +1,14 @@
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]
end
end
end
end
end

@ -0,0 +1,22 @@
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.links = {
home: 'http://ramdajs.com/',
code: 'https://github.com/ramda/ramda/'
}
html_filters.push 'ramda/entries', 'ramda/clean_html', 'title'
options[:title] = 'Ramda'
options[:attribution] = <<-HTML
&copy; 2013&ndash;2014 Scott Sauyet and Michael Hurley<br>
Licensed under the MIT License.
HTML
end
end

@ -0,0 +1 @@
https://camo.githubusercontent.com/0b4c12a5daec02b72e6e6879861ac70f75046e65/687474703a2f2f72616d64612e6a637068696c6c697070732e636f6d2f6c6f676f2f72616d646146696c6c65645f323030783233352e706e67

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Loading…
Cancel
Save