-
Notifications
You must be signed in to change notification settings - Fork 57
/
index.html
137 lines (130 loc) · 5.07 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hive Docs</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/docsify/lib/themes/vue.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://www.youtube.com">
<link rel="preconnect" href="https://i.ytimg.com">
<link rel="preconnect" href="https://i9.ytimg.com">
<link rel="preconnect" href="https://s.ytimg.com">
<style type="text/css">
.container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
.video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/docsify-edit-on-github/index.js"></script>
<script>
window.$docsify = {
name: 'Hive Documentation',
loadSidebar: true,
loadNavbar: true,
subMaxLevel: 2,
auto2top: true,
homepage: 'home.md',
themeColor: '#0AC7EF',
notFoundPage: true,
logo: 'assets/logo.svg',
ga: 'UA-148376435-1',
pagination: {
crossChapter: true
},
plugins: [
EditOnGithubPlugin.create('https://github.com/hivedb/docs/tree/master/', undefined, 'Edit on GitHub'),
function (hook) {
var iframes = {};
hook.beforeEach(function (content) {
iframes = {};
return content.replace(/^```dart:(dart|flutter):([0-9]{1,3})px([^\x05]*?)```/mg, function (m, type, height, code) {
var id = Math.random().toString(36).substr(2, 9);
iframes[id] = code.trim();
return `<iframe style="width:100%;height:${height}px;" data-src="https://dartpad.hivedb.dev/embed-${type}.html" id="${id}" data-hj-allow-iframe></iframe>`;
});
});
hook.doneEach(function () {
for (let [id, code] of Object.entries(iframes)) {
var iframe = document.getElementById(id);
iframe.setAttribute('src', iframe.getAttribute('data-src'));
iframe.onload = function () {
iframe.contentWindow.postMessage({ 'sourceCode': { 'main.dart': code }, 'type': 'sourceCode' }, '*');
};
}
});
},
function (hook) {
var codes = {};
hook.beforeEach(function (content) {
return content.replace(/^```version[^\x05]*?```/mg, function (m) {
if (hiveDependencies !== undefined) {
return '```yaml\n' + hiveDependencies + '\n```';
} else {
return '<pre data-lang="yaml" id="hiveDependencies"></pre>';
}
});
});
}
]
}
window.clearIndexedDb = function () {
var i = document.createElement('iframe');
i.style.visibility = 'hidden';
i.onload = function () { i.parentNode.removeChild(i); };
i.src = 'https://dartpad.hivedb.dev/clear-indexeddb.html';
i.onload = function () {
location.reload();
}
document.body.appendChild(i);
}
window.hj = function () { (h.hj.q = h.hj.q || []).push(arguments) };
window._hjSettings = { hjid: 1654615, hjsv: 6 };
var hiveDependencies;
async function load() {
var url = 'https://api.allorigins.win/get?url=https://pub.dev/api/packages/'
var packages = ['hive', 'hive_flutter', 'hive_generator', 'build_runner']
Promise.all(packages.map(p => fetch(url + p))).then(responses =>
Promise.all(responses.map(res => res.json()))
).then(json => {
var versions = json.map((j) => JSON.parse(j.contents)['latest']['version']);
hiveDependencies = `dependencies:
hive: ^${versions[0]}
hive_flutter: ^${versions[1]}
dev_dependencies:
hive_generator: ^${versions[2]}
build_runner: ^${versions[3]}
`;
var dependencyElement = document.getElementById('hiveDependencies');
if (dependencyElement !== null) {
var highlighted = Prism.highlight(hiveDependencies, Prism.languages.yaml, 'yaml');
dependencyElement.innerHTML = `<code class="language-yaml">${highlighted}</code>` + dependencyElement.innerHTML;
}
})
}
load();
</script>
<script src="https://unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="https://unpkg.com/docsify/lib/plugins/ga.min.js"></script>
<script src="https://unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="https://unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="https://unpkg.com/docsify-copy-code@2"></script>
<script src="https://unpkg.com/prismjs/components/prism-dart.min.js"></script>
<script src="https://unpkg.com/prismjs/components/prism-yaml.min.js"></script>
<script src="https://static.hotjar.com/c/hotjar-1654615.js?sv=6"></script>
</body>