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 @@
1[1[
2 [2 [
3 "2016-02-15",3 "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>"
5 ], [5 ], [
6 "2016-01-31",6 "2016-01-31",
7 "New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>"7 "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
27app.views.NodePage =27app.views.NodePage =
28app.views.PhaserPage =28app.views.PhaserPage =
29app.views.QPage =29app.views.QPage =
30app.views.RamdaPage =
30app.views.RethinkdbPage =31app.views.RethinkdbPage =
31app.views.SinonPage =32app.views.SinonPage =
32app.views.UnderscorePage =33app.views.UnderscorePage =
assets/javascripts/views/pages/ramda.coffee+0−6
@@ -1,6 +0,0 @@
1#= require views/pages/base
2
3class 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
64 'pages/phpunit',64 'pages/phpunit',
65 'pages/postgres',65 'pages/postgres',
66 'pages/q',66 'pages/q',
67 'pages/ramda',
67 'pages/rdoc',68 'pages/rdoc',
68 'pages/react',69 'pages/react',
69 'pages/redis',70 'pages/redis',
assets/stylesheets/global/_icons.scss+1−0
@@ -125,3 +125,4 @@ · 124 unmodified lines
125._icon-tcl_tk:before { background-position: 0 -10rem; }125._icon-tcl_tk:before { background-position: 0 -10rem; }
126._icon-erlang:before { background-position: -1rem -10rem; }126._icon-erlang:before { background-position: -1rem -10rem; }
127._icon-chef:before { background-position: -2rem -10rem; }127._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 @@
1._ramda {1._ramda {
2 @extend %simple;2 @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 }
12 3
13 .see a { @extend %label; }4 code { @extend %code; }
14 5 h3 > small { float: right; }
15 .params {6 ul { margin-top: 1em; }
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 }
33}7}
lib/docs/filters/ramda/clean_html.rb+29−14
@@ -14,30 +14,19 @@ module Docs · 13 unmodified lines
14 added_in.parent = title14 added_in.parent = title
15 end15 end
16 16
17 # Prepend links with 'R.'
18 css('h2 > a.name, .see a').each do |link|
19 link.content = 'R.' + link.content
20 end
21
22 css('.params').each do |node|17 css('.params').each do |node|
23 # Remove params expand link18 # Remove params expand link
24 node.inner_html = node.at_css('.details').inner_html19 node.inner_html = node.at_css('.details').inner_html
25 node.prepend_child "<h4>Parameters</h4>"20 node.prepend_child "<h4>Parameters</h4>"
26 21
27 # Count params
28 if ul = node.at_css('ul')
29 ul.name = 'ol'
30 end
31
32 # change param names to <code>22 # change param names to <code>
33 node.css('span.name').each do |n|23 node.css('span.name').each do |n|
34 n.name = 'code'24 n.name = 'code'
35 n.remove_attribute 'class'
36 end25 end
37 26
38 # change returns to <h4> to make consistant look with params header27 if n = node.at_css('> .panel-body')
39 if returns = node.at_css('span.returns')28 n.before(n.at_css('span.returns').tap { |_n| _n.name = 'h4' })
40 returns.name = 'h4'29 n.replace("<ul><li>#{n.to_html}</li></ul>")
41 end30 end
42 end31 end
43 32
@@ -46,6 +35,32 @@ module Docs · 2 unmodified lines
46 node.content = node.content35 node.content = node.content
47 end36 end
48 37
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
49 doc64 doc
50 end65 end
51 end66 end
lib/docs/filters/ramda/entries.rb+2−5
@@ -2,11 +2,8 @@ module Docs · 1 unmodified line
2 class Ramda2 class Ramda
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def additional_entries4 def additional_entries
5 css('ul.toc li').map do |item|5 css('ul.toc li').map do |node|
6 name = item['data-name']6 ["R.#{node['data-name']}", node['data-name'], node['data-category']]
7 category = item['data-category']
8
9 ['R.' + name, name, category]
10 end7 end
11 end8 end
12 end9 end
lib/docs/scrapers/ramda.rb+1−3
@@ -1,10 +1,8 @@
1module Docs1module Docs
2 class Ramda < UrlScraper2 class Ramda < UrlScraper
3 self.name = 'Ramda'
4 self.slug = 'ramda'
5 self.type = 'ramda'3 self.type = 'ramda'
6 self.release = '0.19.1'4 self.release = '0.19.1'
7 self.base_url = 'http://ramdajs.com/docs'5 self.base_url = "http://ramdajs.com/#{release}/docs/"
8 self.links = {6 self.links = {
9 home: 'http://ramdajs.com/',7 home: 'http://ramdajs.com/',
10 code: 'https://github.com/ramda/ramda/'8 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 @@
1https://camo.githubusercontent.com/0b4c12a5daec02b72e6e6879861ac70f75046e65/687474703a2f2f72616d64612e6a637068696c6c697070732e636f6d2f6c6f676f2f72616d646146696c6c65645f323030783233352e706e671http://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.