new docs init

This commit is contained in:
Harvey Zack committed 2019-04-20 12:46:15 +08:00
1 parent f04493a8fa
commit f2947edacb
36 files changed
+14 -4651

No files matched your search

File diff suppressed because it is too large. Load diff
+25
View File
@@ -0,0 +1,25 @@
(function () {
window.runCode = function(hook) {
hook.ready(function() {
Array.from(document.querySelectorAll('.markdown-section a'))
.filter(function(item) {
return item.innerHTML === 'Run Code';
})
.forEach(function(item) {
item.addEventListener('click', function(event) {
event.preventDefault();
var codeElement = item.parentElement.nextElementSibling;
if (
codeElement.tagName === 'PRE' &&
codeElement.dataset.lang === 'js'
) {
var libs = item.href.split('/lib=')[1] || '';
var code = encodeURIComponent(codeElement.innerText);
var url = 'https://artplayer.org/lab/?libs=' + libs + '&code=' + code;
window.open(url);
}
});
});
});
};
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

+36
View File
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ArtPlayer Document</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="keywords" content="artplayer,html5,video,player">
<meta name="description" content="ArtPlayer is a modern HTML5 video player">
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script src="./common.js"></script>
<script>
window.$docsify = {
name: 'ArtPlayer',
repo: 'zhw2590582/ArtPlayer',
maxLevel: 4,
subMaxLevel: 2,
plugins: [window.runCode]
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?b6c9b8bafbf5fe7225160101dafbbc7d";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>