Skip to content

Commit ab93a30

Browse files
committed
Adding version 0.26.1
1 parent a8acb16 commit ab93a30

File tree

11 files changed

+27498
-524
lines changed

11 files changed

+27498
-524
lines changed

0.26.1/docs/dist/ramda.js

Lines changed: 9239 additions & 0 deletions
Large diffs are not rendered by default.

0.26.1/docs/index.html

Lines changed: 17122 additions & 0 deletions
Large diffs are not rendered by default.

0.26.1/docs/index.html.handlebars

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<!DOCTYPE html>
2+
<html class="docs-page">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Ramda Documentation</title>
7+
<link rel="stylesheet" type="text/css" href="../style.css">
8+
</head>
9+
<body>
10+
<input type="checkbox" id="open-nav">
11+
<header class="navbar navbar-fixed-top navbar-inverse container-fluid">
12+
<div class="container-fluid">
13+
<div class="navbar-header">
14+
<label class="open-nav" for="open-nav"></label>
15+
<a class="navbar-brand" href="#">
16+
<strong>Ramda</strong>
17+
<span class="version">v{{version}}</span>
18+
</a>
19+
</div>
20+
<ul class="nav navbar-nav navbar-left">
21+
<li><a href="../">Home</a></li>
22+
<li class="active"><a href="#">Documentation</a></li>
23+
<li><a href="/repl?v={{version}}">Try Ramda</a></li>
24+
</ul>
25+
<ul class="nav navbar-nav navbar-right">
26+
<li><a href="https://github.com/ramda/ramda">GitHub</a></li>
27+
<li><a href="https://gitter.im/ramda/ramda">Discuss</a></li>
28+
</ul>
29+
</div>
30+
</header>
31+
<aside class="sidebar container-fluid">
32+
<div class="form-group has-feedback filter">
33+
<input class="form-control"
34+
tabindex="1"
35+
id="name-filter"
36+
placeholder="Filter"
37+
type="text"
38+
data-bind="textInput: filter"
39+
autocomplete="false"
40+
autofocus
41+
>
42+
<span class="form-control-feedback">
43+
<span class="glyphicon glyphicon-search"></span>
44+
</span>
45+
</div>
46+
<ul class="nav nav-pills nav-stacked toc">
47+
{{#each docs}}
48+
<li class="func" data-name="{{name}}" data-category="{{category}}">
49+
<a href="#{{name}}">
50+
{{name}}
51+
<span data-category="{{category}}" class="label label-category pull-right"
52+
>{{category}}</span>
53+
</a>
54+
</li>
55+
{{/each}}
56+
</ul>
57+
</aside>
58+
<main class="container-fluid">
59+
{{#each docs}}
60+
<div id="{{name}}" class="section-id"></div>
61+
<section class="card">
62+
<h2>
63+
<a tabindex="2" class="name" href="#{{name}}">{{name}}</a>
64+
<span class="pull-right">
65+
<span class="label label-category">{{category}}</span>
66+
<a target="_blank" title="View source on GitHub" href="https://github.com/ramda/ramda/tree/v{{../version}}/source/{{name}}.js"><small class="glyphicon glyphicon-new-window"></small></a>
67+
</span>
68+
</h2>
69+
70+
{{#if deprecated}}
71+
<div class="deprecated">
72+
Deprecated {{deprecated}}
73+
</div>
74+
{{/if}}
75+
76+
{{#each sigs}}
77+
<div><code>{{this}}</code></div>
78+
{{/each}}
79+
80+
{{#each typedefns}}
81+
<div><code>{{this}}</code></div>
82+
{{/each}}
83+
84+
{{#if returns.type}}
85+
<div class="params" data-expanded="false">
86+
<a href="#expand" class="toggle-params">Parameters</a>
87+
<div class="details panel panel-default">
88+
<ul class="list-group">
89+
{{#each params}}
90+
<li class="list-group-item">
91+
<span class="type">
92+
{{#each type}}
93+
{{this}}
94+
{{#unless @last}} | {{/unless}}
95+
{{/each}}
96+
</span>
97+
<span class="name">{{name}}</span>
98+
<span class="description">{{{description}}}</span>
99+
</li>
100+
{{/each}}
101+
</ul>
102+
<div class="panel-body">
103+
{{#with returns}}
104+
<span class="returns">Returns</span>
105+
<span class="type">{{type}}</span>
106+
<span class="description">{{{description}}}</span>
107+
{{/with}}
108+
</div>
109+
</div>
110+
</div>
111+
{{/if}}
112+
113+
{{#if since}}
114+
<p><small>Added in {{since}}</small></p>
115+
{{/if}}
116+
117+
<div class="description">{{{description}}}</div>
118+
119+
{{#if symb}}
120+
<table class="table table-sm">
121+
<thead>
122+
<tr>
123+
<th>Input</th>
124+
<th>Output</th>
125+
</tr>
126+
</thead>
127+
<tbody>
128+
{{#each symb}}
129+
<tr>
130+
<td><pre class="symbol">{{input}}</pre></td>
131+
<td><pre class="symbol">{{output}}</pre></td>
132+
</tr>
133+
{{/each}}
134+
</tbody>
135+
</table>
136+
{{/if}}
137+
138+
{{#if aka}}
139+
<div class="aka">
140+
Known in other languages or libraries as
141+
{{#each aka}}
142+
{{#unless @first}}{{#unless @last}}{{else}} or{{/unless}}{{/unless}}<code>{{this}}</code>{{#unless @last}},{{else}}.{{/unless}}
143+
{{/each}}
144+
</div>
145+
{{/if}}
146+
147+
{{#if see}}
148+
<div class="see">
149+
See also
150+
{{#each see}}
151+
<a href="#{{this}}">{{this}}</a>{{#unless @last}},{{else}}.{{/unless}}
152+
{{/each}}
153+
</div>
154+
{{/if}}
155+
156+
{{#if example}}
157+
<pre><div class = "try-repl" ><button class = "send-repl" data-ramda-version="{{@root.version}}">Open in REPL</button><button class = "run-here" data-ramda-version="{{@root.version}}">Run it here</button></div><code class="hljs javascript">{{{example}}}</code></pre>
158+
{{/if}}
159+
</section>
160+
{{/each}}
161+
</main>
162+
<script src="dist/ramda.js"></script>
163+
<script src="main.js"></script>
164+
<script src = "https://embed.runkit.com"></script>
165+
</body>
166+
</html>

0.26.1/docs/main.js

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
/* global document, window, R */
2+
3+
(function() {
4+
5+
var findFirst = R.find(R.prop('offsetParent'));
6+
7+
function toArray(xs) {
8+
return Array.prototype.slice.call(xs);
9+
}
10+
11+
function filterTocType(category) {
12+
nameFilter.value = category;
13+
filterToc();
14+
}
15+
16+
function filterToc() {
17+
var f = filterElement.bind(null, nameFilter.value);
18+
funcs.forEach(f);
19+
}
20+
21+
function filterElement(nameFilter, elem) {
22+
elem.style.display =
23+
strIn(nameFilter, elem.getAttribute('data-name')) ||
24+
R.toLower(nameFilter) === R.toLower(elem.getAttribute('data-category')) ?
25+
'' :
26+
'none';
27+
}
28+
29+
function gotoFirst(e) {
30+
if (R.isEmpty(e.detail)) {
31+
return;
32+
}
33+
34+
var func = findFirst(funcs);
35+
if (func) {
36+
var onHashChange = function() {
37+
e.target.focus();
38+
window.removeEventListener('hashchange', onHashChange);
39+
};
40+
41+
// Hash change blurs input, put focus back to input
42+
window.addEventListener('hashchange', onHashChange);
43+
window.location.hash = func.getAttribute('data-name');
44+
}
45+
}
46+
47+
function strIn(a, b) {
48+
a = a.toLowerCase();
49+
b = b.toLowerCase();
50+
return b.indexOf(a) >= 0;
51+
}
52+
53+
function scrollToTop() {
54+
var main = document.querySelector('main');
55+
main.scrollTop = 0;
56+
}
57+
58+
function isTopLink(elem) {
59+
return elem.getAttribute('href') === '#';
60+
}
61+
62+
function isAnchorLink(elem) {
63+
return elem.tagName === 'A' && elem.getAttribute('href').charAt(0) === '#';
64+
}
65+
66+
function closeNav() {
67+
document.getElementById('open-nav').checked = false;
68+
}
69+
70+
function dispatchEvent(event) {
71+
var target = event.target;
72+
var category = target.getAttribute('data-category');
73+
74+
if (isAnchorLink(target)) {
75+
closeNav();
76+
}
77+
if (category) {
78+
filterTocType(category);
79+
}
80+
if (isTopLink(target)) {
81+
scrollToTop(target);
82+
}
83+
}
84+
85+
function keypress(e) {
86+
if (e.which === 13) {
87+
e.target.dispatchEvent(new window.CustomEvent('enter', {
88+
detail: e.target.value
89+
}));
90+
}
91+
}
92+
93+
// https://goo.gl/Zbejtc
94+
function fixedEncodeURIComponent (str) {
95+
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
96+
return '%' + c.charCodeAt(0).toString(16);
97+
});
98+
}
99+
100+
function tryInREPL(event) {
101+
var target = event.target;
102+
var isREPL = target.matches('.send-repl');
103+
var isRun = target.matches('.run-here');
104+
105+
if (!isREPL && !isRun) {
106+
return;
107+
}
108+
109+
var codeElement = target.parentNode.nextElementSibling;
110+
111+
if (isREPL || !window.RunKit) {
112+
var version = event.target.dataset && event.target.dataset.ramdaVersion;
113+
var versionParam = version ? '?v=' + version : '';
114+
var code = codeElement.textContent;
115+
var encoded = fixedEncodeURIComponent(code);
116+
117+
return window.open(location.origin + '/repl/' +
118+
versionParam + '#;' + encoded);
119+
}
120+
121+
var parent = target.parentNode.parentNode;
122+
var ramdaVersion = target.dataset && "@" + target.dataset.ramdaVersion || "";
123+
124+
parent.style.background = "transparent";
125+
parent.style.overflow = "hidden";
126+
127+
var container = document.createElement("div");
128+
129+
container.style.width = "1px";
130+
container.style.height = "1px";
131+
132+
parent.appendChild(container);
133+
134+
RunKit.createNotebook({
135+
element: container,
136+
nodeVersion: '*',
137+
preamble: 'var R = require("ramda' + ramdaVersion + '")',
138+
source: codeElement.textContent,
139+
syntaxTheme: 'atom-dark-syntax',
140+
minHeight: "52px",
141+
onLoad: function(notebook) {
142+
parent.removeChild(codeElement);
143+
parent.removeChild(target.parentNode);
144+
145+
container.style.cssText = "";
146+
147+
var iframe = container.lastElementChild;
148+
iframe.style.cssText = 'height:' + iframe.style.height;
149+
iframe.classList.add('repl-inline');
150+
notebook.evaluate()
151+
}
152+
});
153+
}
154+
155+
156+
var nameFilter = document.getElementById('name-filter');
157+
var funcs = toArray(document.querySelectorAll('.toc .func'));
158+
filterToc();
159+
160+
document.body.addEventListener('click', dispatchEvent, false);
161+
nameFilter.addEventListener('input', filterToc, false);
162+
nameFilter.addEventListener('keypress', keypress, false);
163+
nameFilter.addEventListener('enter', gotoFirst);
164+
document.body.addEventListener('click', tryInREPL);
165+
166+
document.body.addEventListener('keyup', function(event) {
167+
if (191 == event.which)
168+
document.getElementById('name-filter').focus()
169+
});
170+
171+
document.body.addEventListener('click', function(event) {
172+
if (event.target.className.split(' ').indexOf('toggle-params') >= 0) {
173+
var expanded = event.target.parentNode.getAttribute('data-expanded');
174+
event.target.parentNode.setAttribute(
175+
'data-expanded',
176+
expanded === 'true' ? 'false' : 'true'
177+
);
178+
}
179+
}, false);
180+
181+
// back-button hack
182+
window.addEventListener('hashchange', function() {
183+
location.href = location.href;
184+
}, false);
185+
186+
}.call(this));

0 commit comments

Comments
 (0)