Skip to content

Commit b38175f

Browse files
authored
0.24 docs; works on my machine (#179)
1 parent 85811c1 commit b38175f

13 files changed

Lines changed: 28447 additions & 1039 deletions

File tree

0.24.0/docs/dist/ramda.js

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

0.24.0/docs/index.html

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

0.24.0/docs/index.html.handlebars

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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+
autofocus
40+
>
41+
<span class="form-control-feedback">
42+
<span class="glyphicon glyphicon-search"></span>
43+
</span>
44+
</div>
45+
<ul class="nav nav-pills nav-stacked toc">
46+
{{#each docs}}
47+
<li class="func" data-name="{{name}}" data-category="{{category}}">
48+
<a href="#{{name}}">
49+
{{name}}
50+
<span data-category="{{category}}" class="label label-category pull-right"
51+
>{{category}}</span>
52+
</a>
53+
</li>
54+
{{/each}}
55+
</ul>
56+
</aside>
57+
<main class="container-fluid">
58+
{{#each docs}}
59+
<div id="{{name}}" class="section-id"></div>
60+
<section class="card">
61+
<h2>
62+
<a tabindex="2" class="name" href="#{{name}}">{{name}}</a>
63+
<span class="pull-right">
64+
<span class="label label-category">{{category}}</span>
65+
<a target="_blank" title="View source on GitHub" href="https://github.com/ramda/ramda/tree/v{{../version}}/src/{{name}}.js"><small class="glyphicon glyphicon-new-window"></small></a>
66+
</span>
67+
</h2>
68+
69+
{{#if deprecated}}
70+
<div class="deprecated">
71+
Deprecated {{deprecated}}
72+
</div>
73+
{{/if}}
74+
75+
{{#each sigs}}
76+
<div><code>{{this}}</code></div>
77+
{{/each}}
78+
79+
{{#each typedefns}}
80+
<div><code>{{this}}</code></div>
81+
{{/each}}
82+
83+
{{#if returns.type}}
84+
<div class="params" data-expanded="false">
85+
<a href="#expand" class="toggle-params">Parameters</a>
86+
<div class="details panel panel-default">
87+
<ul class="list-group">
88+
{{#each params}}
89+
<li class="list-group-item">
90+
<span class="type">
91+
{{#each type}}
92+
{{this}}
93+
{{#unless @last}} | {{/unless}}
94+
{{/each}}
95+
</span>
96+
<span class="name">{{name}}</span>
97+
<span class="description">{{{description}}}</span>
98+
</li>
99+
{{/each}}
100+
</ul>
101+
<div class="panel-body">
102+
{{#with returns}}
103+
<span class="returns">Returns</span>
104+
<span class="type">{{type}}</span>
105+
<span class="description">{{{description}}}</span>
106+
{{/with}}
107+
</div>
108+
</div>
109+
</div>
110+
{{/if}}
111+
112+
{{#if since}}
113+
<p><small>Added in {{since}}</small></p>
114+
{{/if}}
115+
116+
<div class="description">{{{description}}}</div>
117+
118+
{{#if symb}}
119+
<table class="table table-sm">
120+
<thead>
121+
<tr>
122+
<th>Input</th>
123+
<th>Output</th>
124+
</tr>
125+
</thead>
126+
<tbody>
127+
{{#each symb}}
128+
<tr>
129+
<td><pre class="symbol">{{input}}</pre></td>
130+
<td><pre class="symbol">{{output}}</pre></td>
131+
</tr>
132+
{{/each}}
133+
</tbody>
134+
</table>
135+
{{/if}}
136+
137+
{{#if aka}}
138+
<div class="aka">
139+
Known in other languages or libraries as
140+
{{#each aka}}
141+
{{#unless @first}}{{#unless @last}}{{else}} or{{/unless}}{{/unless}}<code>{{this}}</code>{{#unless @last}},{{else}}.{{/unless}}
142+
{{/each}}
143+
</div>
144+
{{/if}}
145+
146+
{{#if see}}
147+
<div class="see">
148+
See also
149+
{{#each see}}
150+
<a href="#{{this}}">{{this}}</a>{{#unless @last}},{{else}}.{{/unless}}
151+
{{/each}}
152+
</div>
153+
{{/if}}
154+
155+
{{#if example}}
156+
<pre><button class="try-repl" data-ramda-version="{{@root.version}}">Try in REPL</button><code class="hljs javascript">{{{example}}}</code></pre>
157+
{{/if}}
158+
</section>
159+
{{/each}}
160+
</main>
161+
<script src="dist/ramda.js"></script>
162+
<script src="main.js"></script>
163+
</body>
164+
</html>

0.24.0/docs/main.js

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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+
if (!event.target.matches('.try-repl')) {
102+
return;
103+
}
104+
var version = event.target.dataset && event.target.dataset.ramdaVersion;
105+
var versionParam = version ? '?v=' + version : '';
106+
var code = event.target.nextElementSibling.textContent;
107+
var encoded = fixedEncodeURIComponent(code);
108+
location.assign(location.origin + '/repl/' +
109+
versionParam + '#;' + encoded);
110+
}
111+
112+
113+
var nameFilter = document.getElementById('name-filter');
114+
var funcs = toArray(document.querySelectorAll('.toc .func'));
115+
filterToc();
116+
117+
document.body.addEventListener('click', dispatchEvent, false);
118+
nameFilter.addEventListener('input', filterToc, false);
119+
nameFilter.addEventListener('keypress', keypress, false);
120+
nameFilter.addEventListener('enter', gotoFirst);
121+
document.body.addEventListener('click', tryInREPL);
122+
123+
document.body.addEventListener('keyup', function(event) {
124+
if (191 == event.which)
125+
document.getElementById('name-filter').focus()
126+
});
127+
128+
document.body.addEventListener('click', function(event) {
129+
if (event.target.className.split(' ').indexOf('toggle-params') >= 0) {
130+
var expanded = event.target.parentNode.getAttribute('data-expanded');
131+
event.target.parentNode.setAttribute(
132+
'data-expanded',
133+
expanded === 'true' ? 'false' : 'true'
134+
);
135+
}
136+
}, false);
137+
138+
// back-button hack
139+
window.addEventListener('hashchange', function() {
140+
location.href = location.href;
141+
}, false);
142+
143+
}.call(this));

0 commit comments

Comments
 (0)