diff --git a/assets/images/icons.png b/assets/images/icons.png index ac4af351..d40465a1 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index 2e16040d..d9608bac 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 0404492c..e7402374 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2016-02-15", - "New documentations: CakePHP and Chef" + "New documentations: CakePHP, Chef and Ramda" ], [ "2016-01-31", "New documentations: Erlang and Tcl/Tk" diff --git a/assets/javascripts/views/pages/javascript.coffee b/assets/javascripts/views/pages/javascript.coffee index 1658238c..ef8c99e2 100644 --- a/assets/javascripts/views/pages/javascript.coffee +++ b/assets/javascripts/views/pages/javascript.coffee @@ -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 = diff --git a/assets/javascripts/views/pages/ramda.coffee b/assets/javascripts/views/pages/ramda.coffee deleted file mode 100644 index 449b5fd0..00000000 --- a/assets/javascripts/views/pages/ramda.coffee +++ /dev/null @@ -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 diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index daa53fb9..6e9a310f 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -64,6 +64,7 @@ 'pages/phpunit', 'pages/postgres', 'pages/q', + 'pages/ramda', 'pages/rdoc', 'pages/react', 'pages/redis', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 385f03fe..ad8675b5 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -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; } diff --git a/assets/stylesheets/pages/_ramda.scss b/assets/stylesheets/pages/_ramda.scss index 573bc340..a9453057 100644 --- a/assets/stylesheets/pages/_ramda.scss +++ b/assets/stylesheets/pages/_ramda.scss @@ -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; } } diff --git a/lib/docs/filters/ramda/clean_html.rb b/lib/docs/filters/ramda/clean_html.rb index ec5ce5e8..595a83f5 100644 --- a/lib/docs/filters/ramda/clean_html.rb +++ b/lib/docs/filters/ramda/clean_html.rb @@ -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 "
node.css('span.name').each do |n|
n.name = 'code'
- n.remove_attribute 'class'
end
- # change returns to 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("- #{n.to_html}
")
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 "#{node.to_html}
"
+ 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
diff --git a/lib/docs/filters/ramda/entries.rb b/lib/docs/filters/ramda/entries.rb
index 72bfc313..11f064a1 100644
--- a/lib/docs/filters/ramda/entries.rb
+++ b/lib/docs/filters/ramda/entries.rb
@@ -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
diff --git a/lib/docs/scrapers/ramda.rb b/lib/docs/scrapers/ramda.rb
index d9424958..6ab57b2c 100644
--- a/lib/docs/scrapers/ramda.rb
+++ b/lib/docs/scrapers/ramda.rb
@@ -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/'
diff --git a/public/icons/docs/ramda/16.png b/public/icons/docs/ramda/16.png
new file mode 100644
index 00000000..52f021e9
Binary files /dev/null and b/public/icons/docs/ramda/16.png differ
diff --git a/public/icons/docs/ramda/16@2x.png b/public/icons/docs/ramda/16@2x.png
new file mode 100644
index 00000000..bd14b5ce
Binary files /dev/null and b/public/icons/docs/ramda/16@2x.png differ
diff --git a/public/icons/docs/ramda/SOURCE b/public/icons/docs/ramda/SOURCE
index 4ac07377..ce91488e 100644
--- a/public/icons/docs/ramda/SOURCE
+++ b/public/icons/docs/ramda/SOURCE
@@ -1 +1 @@
-https://camo.githubusercontent.com/0b4c12a5daec02b72e6e6879861ac70f75046e65/687474703a2f2f72616d64612e6a637068696c6c697070732e636f6d2f6c6f676f2f72616d646146696c6c65645f323030783233352e706e67
+http://ramda.jcphillipps.com/logo/ramdaFilled_200x235.png
\ No newline at end of file
diff --git a/public/icons/docs/ramda/ramda-16.png b/public/icons/docs/ramda/ramda-16.png
deleted file mode 100644
index 7ebe9cbc..00000000
Binary files a/public/icons/docs/ramda/ramda-16.png and /dev/null differ
diff --git a/public/icons/docs/ramda/ramda-32.png b/public/icons/docs/ramda/ramda-32.png
deleted file mode 100644
index 536d0231..00000000
Binary files a/public/icons/docs/ramda/ramda-32.png and /dev/null differ