forked from WP-API/WP-API.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
105 lines (89 loc) · 2.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: WP API Documentation
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>{{ page.title }}</title>
<!-- Flatdoc -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://rstacruz.github.io/flatdoc/v/0.8.0/legacy.js"></script>
<script src="http://rstacruz.github.io/flatdoc/v/0.8.0/flatdoc.js"></script>
<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/styles.css">
<link rel="stylesheet" href="{{ site.baseurl }}stylesheets/pygment_trac.css">
<script src="http://rstacruz.github.io/flatdoc/v/0.8.0/theme-white/script.js"></script>
<!-- Meta -->
<meta content="WP API" property="og:title">
<meta content="Official Documentation for WP API" name="description">
<!-- Initializer -->
<script>
var multi_github = function(multi) {
var urls = [];
var sort = {};
for (var i = multi.length - 1; i >= 0; i--) {
var bits = multi[i];
var url = 'https://api.github.com/repos/'+bits.repo+'/contents/'+bits.filepath;
sort[bits.filepath] = i;
urls.push(url);
};
return function(callback) {
var requests = [];
for (var i = urls.length - 1; i >= 0; i--) {
requests.push($.get(urls[i]));
};
var promise = $.when.apply(null, requests);
promise.fail(function(e) { callback(e, null); });
promise.done(function(data) {
var responses = Array.prototype.slice.call(arguments);
responses.sort(function (a, b) {
var a_path = a[0].path;
var b_path = b[0].path;
var a_index = sort[a_path];
var b_index = sort[b_path];
return b_index - a_index;
})
var markdown = '';
for (var i = responses.length - 1; i >= 0; i--) {
markdown += window.Base64.decode( responses[i][0].content );
};
callback(null, markdown);
});
};
};
function slugify(text) {
return text.toLowerCase().match(/[a-z0-9]+/g).join('-');
}
Flatdoc.transformer.addIDs = function($content) {
$content.find('h1, h2, h3').each(function() {
var $el = $(this);
var text = $el.text();
var id = slugify(text);
switch ($el[0].nodeName) {
case 'H3':
var text = $el.prevAll("h2").first().text();
var id = slugify(text) + '_' + id;
// Fall-through
case 'H2':
var text = $el.prevAll("h1").first().text();
var id = slugify(text) + '_' + id;
}
$el.attr('id', id);
});
};
Flatdoc.run({
fetcher: multi_github([
{ repo: "WP-API/WP-API", filepath: "README.md" },
{ repo: "WP-API/WP-API", filepath: "docs/routes/routes.md" },
])
});
</script>
</head>
{% include header.html %}
<div class="content-root">
{% include sidebar.html %}
<div role="flatdoc-content" class="content"></div>
</div>
{% include footer.html %}