Bläddra i källkod

chore: 调整架构

2637309949@qq.com 5 år sedan
incheckning
f22c8e34cf
16 ändrade filer med 601 tillägg och 0 borttagningar
  1. 0 0
      .nojekyll
  2. 3 0
      README.md
  3. 14 0
      _coverpage.md
  4. BIN
      _images/deploy-github-pages.png
  5. 30 0
      _media/icon.svg
  6. 3 0
      _navbar.md
  7. 29 0
      _sidebar.md
  8. 136 0
      deploy.md
  9. 130 0
      git/README.md
  10. 0 0
      golang/README.md
  11. 0 0
      host/README.md
  12. 37 0
      index.html
  13. 0 0
      k8s/README.md
  14. 0 0
      linux/README.md
  15. 125 0
      more-pages.md
  16. 94 0
      quickstart.md

+ 0 - 0
.nojekyll


+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+## development-manual
+
+> A magical documentation site generator.

+ 14 - 0
_coverpage.md

@@ -0,0 +1,14 @@
+<!-- _coverpage.md -->
+
+![logo](_media/icon.svg)
+
+# Development Manual
+
+> A magical documentation site generator.
+
+- Simple and lightweight (~21kB gzipped)
+- No statically built html files
+- Multiple themes
+
+[GitHub](https://git.i2erp.cn/i2-tech/development-manual/)
+[Get Started](#development-manual)

BIN
_images/deploy-github-pages.png


+ 30 - 0
_media/icon.svg

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="122px" height="94px" viewBox="0 0 122 94" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 41.2 (35397) - http://www.bohemiancoding.com/sketch -->
+    <title>icon</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <path d="M144.453286,104 C177.038086,104 203.453286,77.5848002 203.453286,45 C203.453286,12.4151998 177.038086,-14 144.453286,-14 C111.868486,-14 114.603207,13.6754846 114.603207,46.2602848 C114.603207,78.845085 111.868486,104 144.453286,104 Z" id="path-1"></path>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-2">
+            <feOffset dx="7" dy="-10" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
+            <feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.1 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
+        </filter>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="icon" transform="translate(-98.000000, 2.000000)">
+            <g id="body" transform="translate(159.000000, 45.000000) rotate(-90.000000) translate(-159.000000, -45.000000) ">
+                <use fill="#2ECE53" fill-rule="evenodd" xlink:href="#path-1"></use>
+                <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
+                <use stroke="#0E1320" stroke-width="4" xlink:href="#path-1"></use>
+            </g>
+            <circle id="left-eye" fill="#000000" cx="139" cy="38" r="7"></circle>
+            <circle id="right-eye" fill="#000000" cx="183" cy="38" r="7"></circle>
+            <g id="light" transform="translate(112.000000, 10.000000)" fill="#FFFFFF">
+                <circle cx="2" cy="28" r="2"></circle>
+                <path d="M12.2551528,-1.65016666 C12.1154537,-2.17684986 12.4455583,-2.60381096 13.011574,-2.60381096 L14.9928363,-2.60381096 C15.5502953,-2.60381096 16.1214654,-2.16566487 16.2594657,-1.64268776 C16.2594657,-1.64268776 17.4280152,2.48668594 17.9030739,6.45786647 C18.3781327,10.429047 18.3171359,10.4652901 18.3171359,12.1782569 C18.3171359,16.9413523 16.2076398,26.4389164 16.2076398,26.4389164 C16.0941814,26.9676035 15.558852,27.396189 14.9928363,27.396189 L13.011574,27.396189 C12.454115,27.396189 12.1166642,26.9691757 12.2568366,26.4301177 C12.2568366,26.4301177 13.4260575,22.2288768 13.9640759,17.9859148 C14.5020943,13.7429529 14.309594,15.2982629 14.5626609,12.3723978 C14.9355337,8.06138047 12.2551528,-1.65016666 12.2551528,-1.65016666 Z" id="light-line" transform="translate(15.271433, 12.396189) scale(-1, 1) rotate(-48.000000) translate(-15.271433, -12.396189) "></path>
+            </g>
+            <path d="M159.5,78.3050108 C169.164983,78.3050108 177,70.4699939 177,60.8050108 C177,51.1400277 169.688728,56.4616841 160.023745,56.4616841 C150.358762,56.4616841 142,51.1400277 142,60.8050108 C142,70.4699939 149.835017,78.3050108 159.5,78.3050108 Z" id="mouth" fill="#000000"></path>
+        </g>
+    </g>
+</svg>

+ 3 - 0
_navbar.md

@@ -0,0 +1,3 @@
+- Translations
+  - [:uk: English](/)
+  - [:cn: 中文](/zh-cn/)

+ 29 - 0
_sidebar.md

@@ -0,0 +1,29 @@
+* 文档教程
+    * [快速入门](quickstart.md)
+    * [发布页面](more-pages.md)
+    * [部署项目](deploy.md)
+* Host网址
+    * [开发环境](/host/README.md)
+    * [测试环境](/host/README.md)
+    * [工具环境](/host/README.md)
+* Git教程
+    * [快速入门](/git/README.md)
+    * [提交规范](/git/README.md)
+* Linux教程
+    * [快速入门](/linux/README.md)
+    * [提交规范](/linux/README.md)
+* K8S教程
+    * [快速入门](/k8s/README.md)
+    * [提交规范](/k8s/README.md)
+* Vue教程
+    * [快速入门](/vue/README.md)
+    * [提交规范](/vue/README.md)
+* Dart教程
+    * [快速入门](/dart/README.md)
+    * [提交规范](/dart/README.md)
+* GO教程
+    * [快速入门](/go/README.md)
+    * [提交规范](/go/README.md)
+* Redis教程
+    * [快速入门](/redis/README.md)
+    * [提交规范](/redis/README.md)

+ 136 - 0
deploy.md

@@ -0,0 +1,136 @@
+# Deploy
+
+Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages, GitLab Pages or VPS.
+
+## GitHub Pages
+
+There're three places to populate your docs for your Github repository:
+
+- `docs/` folder
+- master branch
+- gh-pages branch
+
+It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
+
+![github pages](_images/deploy-github-pages.png)
+
+!> You can also save files in the root directory and select `master branch`.
+You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch)
+
+## GitLab Pages
+
+If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
+
+?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
+
+```YAML
+pages:
+  stage: deploy
+  script:
+  - mkdir .public
+  - cp -r * .public
+  - mv .public public
+  artifacts:
+    paths:
+    - public
+  only:
+  - master
+```
+
+!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
+
+## Firebase Hosting
+
+!> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account.
+
+Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions.
+
+You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`):
+
+```json
+{
+  "hosting": {
+    "public": "site",
+    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
+  }
+}
+```
+
+Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the base project directory.
+
+## VPS
+
+Try following nginx config.
+
+```nginx
+server {
+  listen 80;
+  server_name  your.domain.com;
+
+  location / {
+    alias /path/to/dir/of/docs/;
+    index index.html;
+  }
+}
+```
+
+## Netlify
+
+1.  Login to your [Netlify](https://www.netlify.com/) account.
+2.  In the [dashboard](https://app.netlify.com/) page, click **New site from Git**.
+3.  Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
+
+### HTML5 router
+
+When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, create a file named `_redirects` in the docs directory, add this snippet to the file and you're all set:
+
+```sh
+/*    /index.html   200
+```
+
+## ZEIT Now
+
+1. Install [Now CLI](https://zeit.co/download), `npm i -g now`
+2. Change directory to your docsify website, for example `cd docs`
+3. Deploy with a single command, `now` 
+
+## AWS Amplify
+
+1. Set the routerMode in the Docsify project `index.html` to *history* mode.
+
+```html
+<script>
+    window.$docsify = {
+      loadSidebar: true,
+      routerMode: 'history'
+    }
+</script>
+```
+
+2. Login to your [AWS Console](https://aws.amazon.com).
+3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify).
+4. Choose the **Deploy** route to setup your project.
+5. When prompted, keep the build settings empty if you're serving your docs within the root directory. If you're serving your docs from a different directory, customise your amplify.yml
+
+```yml
+version: 0.1
+frontend:
+  phases:
+    build:
+      commands: 
+        - echo "Nothing to build"
+  artifacts:
+    baseDirectory: /docs
+    files:
+      - '**/*'
+  cache:
+    paths: []
+
+```
+
+6. Add the following Redirect rules in their displayed order.
+
+| Source address | Target address | Type          |
+|----------------|----------------|---------------|
+| /<*>.md        | /<*>.md        | 200 (Rewrite) |
+| /<*>           | /index.html    | 200 (Rewrite) |        

+ 130 - 0
git/README.md

@@ -0,0 +1,130 @@
+## 安装
+[下载 git OSX 版](http://code.google.com/p/git-osx-installer/downloads/list?can=3)  
+[下载 git Windows 版](http://code.google.com/p/msysgit/downloads/list?can=3)  
+[下载 git Linux 版](http://book.git-scm.com/2_installing_git.html)  
+
+## 创建新仓库
+创建新文件夹,打开,然后执行
+```bash
+git init
+```
+以创建新的 git 仓库。
+
+## 检出仓库
+执行如下命令以创建一个本地仓库的克隆版本:
+```bash
+git clone /path/to/repository
+```
+如果是远端服务器上的仓库,你的命令会是这个样子:
+```bash
+git clone username@host:/path/to/repository
+```
+
+## 工作流
+你的本地仓库由 git 维护的三棵“树”组成。第一个是你的 工作目录,它持有实际文件;第二个是 缓存区(Index),它像个缓存区域,临时保存你的改动;最后是 HEAD,指向你最近一次提交后的结果。
+![trees](https://www.bootcss.com/p/git-guide/img/trees.png)
+
+## 添加与提交
+你可以计划改动(把它们添加到缓存区),使用如下命令:
+```bash
+git add <filename>
+git add *
+```
+这是 git 基本工作流程的第一步;使用如下命令以实际提交改动:
+git commit -m "代码提交信息"
+现在,你的改动已经提交到了 HEAD,但是还没到你的远端仓库。
+
+## 推送改动
+你的改动现在已经在本地仓库的 HEAD 中了。执行如下命令以将这些改动提交到远端仓库:
+```bash
+git push origin master
+```
+可以把 master 换成你想要推送的任何分支。
+
+如果你还没有克隆现有仓库,并欲将你的仓库连接到某个远程服务器,你可以使用如下命令添加:
+```bash
+git remote add origin <server>
+```
+如此你就能够将你的改动推送到所添加的服务器上去了。
+
+## 分支
+分支是用来将特性开发绝缘开来的。在你创建仓库的时候,master 是“默认的”。在其他分支上进行开发,完成后再将它们合并到主分支上。
+![branches](https://www.bootcss.com/p/git-guide/img/branches.png)
+
+创建一个叫做“feature_x”的分支,并切换过去:
+```bash
+git checkout -b feature_x
+```
+切换回主分支:
+```bash
+git checkout master
+```
+再把新建的分支删掉:
+```bash
+git branch -d feature_x
+```
+除非你将分支推送到远端仓库,不然该分支就是 不为他人所见的:
+```bash
+git push origin <branch>
+```
+
+## 更新与合并
+要更新你的本地仓库至最新改动,执行:
+```bash
+git pull
+```
+以在你的工作目录中 获取(fetch) 并 合并(merge) 远端的改动。
+要合并其他分支到你的当前分支(例如 master),执行:
+```bash
+git merge <branch>
+```
+两种情况下,git 都会尝试去自动合并改动。不幸的是,自动合并并非次次都能成功,并可能导致 冲突(conflicts)。 这时候就需要你修改这些文件来人肉合并这些 冲突(conflicts) 了。改完之后,你需要执行如下命令以将它们标记为合并成功:
+```bash
+git add <filename>
+```
+在合并改动之前,也可以使用如下命令查看:
+```bash
+git diff <source_branch> <target_branch>
+```
+
+## 标签
+在软件发布时创建标签,是被推荐的。这是个旧有概念,在 SVN 中也有。可以执行如下命令以创建一个叫做 1.0.0 的标签:
+```bash
+git tag 1.0.0 1b2e1d63ff
+```
+1b2e1d63ff 是你想要标记的提交 ID 的前 10 位字符。使用如下命令获取提交 ID:
+```bash
+git log
+```
+你也可以用该提交 ID 的少一些的前几位,只要它是唯一的。
+
+## 替换本地改动
+假如你做错事(自然,这是不可能的),你可以使用如下命令替换掉本地改动:
+```bash
+git checkout -- <filename>
+```
+此命令会使用 HEAD 中的最新内容替换掉你的工作目录中的文件。已添加到缓存区的改动,以及新文件,都不受影响。
+
+假如你想要丢弃你所有的本地改动与提交,可以到服务器上获取最新的版本并将你本地主分支指向到它:
+```bash
+git fetch origin
+git reset --hard origin/master
+```
+
+## 有用的贴士
+内建的图形化 git:
+```bash
+gitk
+```
+彩色的 git 输出:
+```bash
+git config color.ui true
+```
+显示历史记录时,只显示一行注释信息:
+```bash
+git config format.pretty oneline
+```
+交互地添加文件至缓存区:
+```bash
+git add -i
+```

+ 0 - 0
golang/README.md


+ 0 - 0
host/README.md


+ 37 - 0
index.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <title>Document</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://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">
+</head>
+
+<body>
+  <div id="app"></div>
+  <script>
+    window.$docsify = {
+      search: 'auto',
+      coverpage: true,
+      loadSidebar: true,
+      subMaxLevel: 2
+    }
+  </script>
+  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
+  <script src="//cdn.jsdelivr.net/npm/docsify-themeable@0"></script>
+  <script src="//unpkg.com/prismjs/components/prism-go.min.js"></script>
+  <script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
+  <script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
+  <script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
+  <script src="//unpkg.com/prismjs/components/prism-javascript.min.js"></script>
+  <script src="//unpkg.com/prismjs/components/prism-dart.min.js"></script>
+  <script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
+  <script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
+  <script src="//unpkg.com/docsify-copy-code"></script>
+</body>
+
+</html>

+ 0 - 0
k8s/README.md


+ 0 - 0
linux/README.md


+ 125 - 0
more-pages.md

@@ -0,0 +1,125 @@
+# More pages
+
+If you need more pages, you can simply create more markdown files in your docsify directory. If you create a file named `guide.md`, then it is accessible via `/#/guide`.
+
+For example, the directory structure is as follows:
+
+```text
+.
+└── docs
+    ├── README.md
+    ├── guide.md
+    └── zh-cn
+        ├── README.md
+        └── guide.md
+```
+
+Matching routes
+
+```text
+docs/README.md        => http://domain.com
+docs/guide.md         => http://domain.com/#/guide
+docs/zh-cn/README.md  => http://domain.com/#/zh-cn/
+docs/zh-cn/guide.md   => http://domain.com/#/zh-cn/guide
+```
+
+## Sidebar
+
+In order to have sidebar, then you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/docsifyjs/docsify/blob/master/docs/_sidebar.md) for an example):
+
+First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#loadsidebar).
+
+```html
+<!-- index.html -->
+
+<script>
+  window.$docsify = {
+    loadSidebar: true
+  }
+</script>
+<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
+```
+
+Create the `_sidebar.md`:
+
+```markdown
+<!-- docs/_sidebar.md -->
+
+* [Home](/)
+* [Guide](guide.md)
+```
+
+You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
+
+## Nested Sidebars
+
+You may want the sidebar to update with only navigation to reflect the current directory. This can be done by adding a `_sidebar.md` file to each folder.
+
+`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
+
+You can specify `alias` to avoid unnecessary fallback.
+
+```html
+<script>
+  window.$docsify = {
+    loadSidebar: true,
+    alias: {
+      '/.*/_sidebar.md': '/_sidebar.md'
+    }
+  }
+</script>
+```
+
+!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
+
+## Set Page Titles from Sidebar Selection
+
+A page's `title` tag is generated from the _selected_ sidebar item name. For better SEO, you can customize the title by specifying a string after the filename.
+
+```markdown
+<!-- docs/_sidebar.md -->
+* [Home](/)
+* [Guide](guide.md "The greatest guide in the world")
+```
+
+## Table of Contents
+
+Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
+
+A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [subMaxLevel configuration](configuration.md#submaxlevel).
+
+```html
+<!-- index.html -->
+
+<script>
+  window.$docsify = {
+    loadSidebar: true,
+    subMaxLevel: 2
+  }
+</script>
+<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
+```
+
+## Ignoring Subheaders
+
+When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
+
+```markdown
+# Getting Started
+
+## Header {docsify-ignore}
+
+This header won't appear in the sidebar table of contents.
+```
+
+To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
+
+```markdown
+# Getting Started {docsify-ignore-all}
+
+## Header
+
+This header won't appear in the sidebar table of contents.
+```
+
+Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.

+ 94 - 0
quickstart.md

@@ -0,0 +1,94 @@
+# Quick start
+
+It is recommended to install `docsify-cli` globally, which helps initializing and previewing the website locally.
+
+```bash
+npm i docsify-cli -g
+```
+
+## Initialize
+
+If you want to write the documentation in the `./docs` subdirectory, you can use the `init` command.
+
+```bash
+docsify init ./docs
+```
+
+## Writing content
+
+After the `init` is complete, you can see the file list in the `./docs` subdirectory.
+
+* `index.html` as the entry file
+* `README.md` as the home page
+* `.nojekyll` prevents GitHub Pages from ignoring files that begin with an underscore
+
+You can easily update the documentation in `./docs/README.md`, of course you can add [more pages](more-pages.md).
+
+## Preview your site
+
+Run the local server with `docsify serve`. You can preview your site in your browser on `http://localhost:3000`.
+
+```bash
+docsify serve docs
+```
+
+?> For more use cases of `docsify-cli`, head over to the [docsify-cli documentation](https://github.com/docsifyjs/docsify-cli).
+
+## Manual initialization
+
+If you don't like `npm` or have trouble installing the tool, you can manually create `index.html`:
+
+```html
+<!-- index.html -->
+
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+  <meta charset="UTF-8">
+  <link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
+</head>
+<body>
+  <div id="app"></div>
+  <script>
+    window.$docsify = {
+      //...
+    }
+  </script>
+  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
+</body>
+</html>
+```
+
+If you installed python on your system, you can easily use it to run a static server to preview your site.
+
+```bash
+cd docs && python -m SimpleHTTPServer 3000
+```
+
+## Loading dialog
+
+If you want, you can show a loading dialog before docsify starts to render your documentation:
+
+```html
+  <!-- index.html -->
+
+  <div id="app">Please wait...</div>
+```
+
+You should set the `data-app` attribute if you changed `el`:
+
+```html
+  <!-- index.html -->
+
+  <div data-app id="main">Please wait...</div>
+
+  <script>
+    window.$docsify = {
+      el: '#main'
+    }
+  </script>
+```
+
+Compare [el configuration](configuration.md#el).