Browse Source

build docs with docute, cc @egoist

DIYgod 8 years ago
parent
commit
bd3f0a0df9
5 changed files with 38 additions and 51 deletions
  1. 0 0
      docs/.nojekyll
  2. 1 1
      docs/README.md
  3. 13 0
      docs/config.js
  4. 24 8
      docs/index.html
  5. 0 42
      docs/package.json

+ 0 - 0
docs/.nojekyll


+ 1 - 1
docs/README.md

@@ -66,7 +66,7 @@ var dp = new DPlayer({
         maximum: 1000,                                                 // Optional, maximum quantity of danmaku
         addition: ['https://api.prprpr.me/dplayer/bilibili?aid=4157142']   // Optional, additional danmaku, see: `Bilibili 弹幕支持`
     }
-})
+});
 ```
 
 ### API

+ 13 - 0
docs/config.js

@@ -0,0 +1,13 @@
+self.$config = {
+  title: 'DPlayer docs',
+  repo: 'DIYgod/DPlayer',
+  'edit-link': 'https://github.com/DIYgod/DPlayer/blob/gh-pages/docs',
+  icons: [
+    {
+      label: '关注我的微博',
+      svgId: 'i-weibo',
+      svgClass: 'weibo-icon',
+      link: 'http://weibo.com/anotherhome'
+    }
+  ],
+}

+ 24 - 8
docs/index.html

@@ -1,14 +1,30 @@
 <!DOCTYPE html>
-<html lang="en">
+<html>
 <head>
-  <meta charset="UTF-8">
-  <title>dplayer</title>
-  <meta name="description" content="Wow, such a lovely HTML5 danmaku video player">
-  <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="//unpkg.com/docsify/themes/vue.css">
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
+  <title>Docute</title>
+  <link rel="stylesheet" href="https://unpkg.com/docute@latest/dist/docute.css">
+  <style>
+    .weibo-icon {
+      fill: #666;
+    }
+    .weibo-icon:hover {
+      fill: #333;
+    }
+  </style>
 </head>
 <body>
+  <!-- don't remove this part start -->
   <div id="app"></div>
+  <!-- 添加到任意 #app 以外的地方-->
+  <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
+    <symbol id="i-weibo" viewBox="0 0 16 16"><path d="M6.72 13.532c-2.647.26-4.934-.936-5.106-2.675C1.442 9.12 3.45 7.497 6.1 7.235c2.648-.262 4.934.935 5.106 2.674.172 1.738-1.836 3.36-4.485 3.622zm-.697-2.066c-.256.41-.804.588-1.218.4-.407-.186-.527-.66-.27-1.06.252-.396.783-.573 1.193-.4.415.175.547.647.295 1.06zm.845-1.083c-.093.158-.298.234-.458.168-.158-.064-.208-.24-.118-.397.092-.154.29-.23.447-.167.16.058.216.237.128.397zm.118-1.81c-1.26-.328-2.685.3-3.233 1.41-.557 1.134-.018 2.39 1.255 2.802 1.32.426 2.874-.226 3.415-1.45.533-1.194-.133-2.425-1.437-2.762zm5.033-.814c-.226-.068-.38-.114-.263-.41.256-.643.282-1.197.005-1.593-.52-.742-1.94-.702-3.57-.02 0 0-.51.224-.38-.182.25-.805.213-1.48-.177-1.87-.884-.884-3.234.034-5.25 2.05C.876 7.242 0 8.842 0 10.224c0 2.647 3.393 4.255 6.713 4.255 4.35 0 7.246-2.528 7.246-4.535 0-1.213-1.023-1.9-1.94-2.186zm1.275-3.386c-.51-.568-1.266-.783-1.964-.635-.284.06-.465.34-.404.625.06.284.34.467.625.405.342-.072.71.033.962.31.25.278.317.656.21.987-.09.277.062.575.34.665.277.088.574-.063.663-.34.22-.678.083-1.45-.43-2.018zm1.614-1.457c-1.052-1.165-2.602-1.61-4.033-1.304-.33.07-.542.396-.47.727.07.33.395.542.726.47 1.018-.215 2.12.1 2.866.928.746.828.948 1.957.63 2.946-.106.323.07.668.393.772.322.104.667-.072.772-.394V7.06c.448-1.392.165-2.98-.886-4.143z"/></symbol>
+  </svg>
+  <script src="./config.js"></script>
+  <script src="https://unpkg.com/docute@latest/dist/docute.js"></script>
+  <!-- livereload script placeholder -->
+  <!-- don't remove this part end -->
 </body>
-<script src="//unpkg.com/docsify/lib/docsify.js" data-repo="git+https://github.com/DIYgod/DPlayer"></script>
-</html>
+</html>

+ 0 - 42
docs/package.json

@@ -1,42 +0,0 @@
-{
-  "name": "dplayer",
-  "version": "1.1.2",
-  "description": "Wow, such a lovely HTML5 danmaku video player",
-  "main": "dist/DPlayer.min.js",
-  "scripts": {
-    "test": "webpack",
-    "start": "webpack-dev-server --hot --progress --inline --host 0.0.0.0"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/DIYgod/DPlayer.git"
-  },
-  "keywords": [
-    "player",
-    "danmaku",
-    "video",
-    "html5"
-  ],
-  "author": "DIYgod",
-  "license": "SATA",
-  "bugs": {
-    "url": "https://github.com/DIYgod/DPlayer/issues"
-  },
-  "homepage": "https://github.com/DIYgod/DPlayer#readme",
-  "devDependencies": {
-    "autoprefixer": "^6.4.0",
-    "babel-core": "^6.18.0",
-    "babel-loader": "^6.2.4",
-    "babel-preset-es2015": "^6.13.2",
-    "css-loader": "^0.26.0",
-    "exports-loader": "^0.6.3",
-    "file-loader": "^0.9.0",
-    "node-sass": "^3.8.0",
-    "postcss-loader": "^1.0.0",
-    "sass-loader": "^4.0.0",
-    "style-loader": "^0.13.1",
-    "url-loader": "^0.5.7",
-    "webpack": "^1.13.1",
-    "webpack-dev-server": "^1.14.1"
-  }
-}