History

Finish Ramda documentation

Thibaut Courouble committed 10 years ago

Commit 23d3a021 parent 38f100f16 files · +34 −53Browse files

Unified · Split

16 files
  1. assets/images/icons.png +0 −0
  2. assets/images/icons@2x.png +0 −0
  3. assets/javascripts/news.json +1 −1
  4. assets/javascripts/views/pages/javascript.coffee +1 −0
  5. assets/javascripts/views/pages/ramda.coffee +0 −6
  6. assets/stylesheets/application-dark.css.scss +1 −0
  7. assets/stylesheets/global/_icons.scss +1 −0
  8. assets/stylesheets/pages/_ramda.scss +3 −29
  9. lib/docs/filters/ramda/clean_html.rb +29 −14
  10. lib/docs/filters/ramda/entries.rb +2 −5
  11. lib/docs/scrapers/ramda.rb +1 −3
  12. public/icons/docs/ramda/16.png +0 −0
  13. public/icons/docs/ramda/16@2x.png +0 −0
  14. public/icons/docs/ramda/SOURCE +1 −1
  15. public/icons/docs/ramda/ramda-16.png +0 −0
  16. public/icons/docs/ramda/ramda-32.png +0 −0
assets/images/icons.png+0−0

Binary file not shown.

assets/images/icons@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
11 [
22 [
33 "2016-02-15",
4− "New documentations: <a href=\"/cakephp/\">CakePHP</a> and <a href=\"/chef/\">Chef</a>"
4+ "New documentations: <a href=\"/cakephp/\">CakePHP</a>, <a href=\"/chef/\">Chef</a> and <a href=\"/ramda/\">Ramda</a>"
55 ], [
66 "2016-01-31",
77 "New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>"
assets/javascripts/views/pages/javascript.coffee+1−0
@@ -27,6 +27,7 @@ app.views.MongoosePage = · 26 unmodified lines
2727 app.views.NodePage =
2828 app.views.PhaserPage =
2929 app.views.QPage =
30+app.views.RamdaPage =
3031 app.views.RethinkdbPage =
3132 app.views.SinonPage =
3233 app.views.UnderscorePage =
assets/javascripts/views/pages/ramda.coffee+0−6
@@ -1,6 +0,0 @@
1−#= require views/pages/base
2−
3−class app.views.RamdaPage extends app.views.BasePage
4− prepare: ->
5− @highlightCode @findAll('section > pre:last-child'), 'javascript'
6− return
assets/stylesheets/application-dark.css.scss+1−0
@@ -64,6 +64,7 @@ · 63 unmodified lines
6464 'pages/phpunit',
6565 'pages/postgres',
6666 'pages/q',
67+ 'pages/ramda',
6768 'pages/rdoc',
6869 'pages/react',
6970 'pages/redis',
assets/stylesheets/global/_icons.scss+1−0
@@ -125,3 +125,4 @@ · 124 unmodified lines
125125 ._icon-tcl_tk:before { background-position: 0 -10rem; }
126126 ._icon-erlang:before { background-position: -1rem -10rem; }
127127 ._icon-chef:before { background-position: -2rem -10rem; }
128+._icon-ramda:before { background-position: -3rem -10rem; @extend %darkIconFix !optional; }
assets/stylesheets/pages/_ramda.scss+3−29
@@ -1,33 +1,7 @@
11 ._ramda {
22 @extend %simple;
3− code { @extend %code; }
4− h2 + div > code { @extend %block-label, %label-blue; }
5−
6− h2 {
7− small {
8− font-size: small;
9− float: right;
10− }
11− }
123
13− .see a { @extend %label; }
14−
15− .params {
16− .type {
17− font-style: italic;
18− text-transform: capitalize;
19− margin-right: 0.35em;
20− &::before { content: '<'; }
21− &::after { content: '>'; }
22− }
23− .panel-body {
24− margin-bottom: 1.5em;
25− .type {
26− padding: 0 0 0 2em;
27− }
28− .description > p {
29− display: inline-block;
30− }
31− }
32− }
4+ code { @extend %code; }
5+ h3 > small { float: right; }
6+ ul { margin-top: 1em; }
337 }
lib/docs/filters/ramda/clean_html.rb+29−14
@@ -14,30 +14,19 @@ module Docs · 13 unmodified lines
1414 added_in.parent = title
1515 end
1616
17− # Prepend links with 'R.'
18− css('h2 > a.name, .see a').each do |link|
19− link.content = 'R.' + link.content
20− end
21−
2217 css('.params').each do |node|
2318 # Remove params expand link
2419 node.inner_html = node.at_css('.details').inner_html
2520 node.prepend_child "<h4>Parameters</h4>"
2621
27− # Count params
28− if ul = node.at_css('ul')
29− ul.name = 'ol'
30− end
31−
3222 # change param names to <code>
3323 node.css('span.name').each do |n|
3424 n.name = 'code'
35− n.remove_attribute 'class'
3625 end
3726
38− # change returns to <h4> to make consistant look with params header
39− if returns = node.at_css('span.returns')
40− returns.name = 'h4'
27+ if n = node.at_css('> .panel-body')
28+ n.before(n.at_css('span.returns').tap { |_n| _n.name = 'h4' })
29+ n.replace("<ul><li>#{n.to_html}</li></ul>")
4130 end
4231 end
4332
@@ -46,6 +35,32 @@ module Docs · 2 unmodified lines
4635 node.content = node.content
4736 end
4837
38+ css('div.see').each do |node|
39+ node.name = 'p'
40+ end
41+
42+ css('.see a').each do |node|
43+ node.replace "<code>#{node.to_html}</code>"
44+ end
45+
46+ css('h2 + div > code:only-child').each do |node|
47+ node.parent.name = 'pre'
48+ node.parent.content = node.content
49+ end
50+
51+ css('.card').each do |node|
52+ node.at_css('h2')['id'] = node['id'] if node['id']
53+ node.before(node.children).remove
54+ end
55+
56+ css('.panel-body', 'div.params', 'div.description', 'h2 > a').each do |node|
57+ node.before(node.children).remove
58+ end
59+
60+ css('h2').each do |node|
61+ node.name = 'h3'
62+ end
63+
4964 doc
5065 end
5166 end
lib/docs/filters/ramda/entries.rb+2−5
@@ -2,11 +2,8 @@ module Docs · 1 unmodified line
22 class Ramda
33 class EntriesFilter < Docs::EntriesFilter
44 def additional_entries
5− css('ul.toc li').map do |item|
6− name = item['data-name']
7− category = item['data-category']
8−
9− ['R.' + name, name, category]
5+ css('ul.toc li').map do |node|
6+ ["R.#{node['data-name']}", node['data-name'], node['data-category']]
107 end
118 end
129 end
lib/docs/scrapers/ramda.rb+1−3
@@ -1,10 +1,8 @@
11 module Docs
22 class Ramda < UrlScraper
3− self.name = 'Ramda'
4− self.slug = 'ramda'
53 self.type = 'ramda'
64 self.release = '0.19.1'
7− self.base_url = 'http://ramdajs.com/docs'
5+ self.base_url = "http://ramdajs.com/#{release}/docs/"
86 self.links = {
97 home: 'http://ramdajs.com/',
108 code: 'https://github.com/ramda/ramda/'
public/icons/docs/ramda/16.png+0−0

Binary file not shown.

public/icons/docs/ramda/16@2x.png+0−0

Binary file not shown.

public/icons/docs/ramda/SOURCE+1−1
@@ -1 +1 @@
1−https://camo.githubusercontent.com/0b4c12a5daec02b72e6e6879861ac70f75046e65/687474703a2f2f72616d64612e6a637068696c6c697070732e636f6d2f6c6f676f2f72616d646146696c6c65645f323030783233352e706e67
1+http://ramda.jcphillipps.com/logo/ramdaFilled_200x235.png
public/icons/docs/ramda/ramda-16.png+0−0

Binary file not shown.

public/icons/docs/ramda/ramda-32.png+0−0

Binary file not shown.