開源文檔管理


1.ShowDoc

https://gitee.com/star7th/showdoc.git

2.gitbook

  (1)安裝nodejs

  (2)安裝gitbook

cnpm install gitbook-cli -g

  (3)安裝是否成功

   (4)初始化

gitbook init

自動生成文件

   (5)啟動並測試

gitbook serve

 瀏覽器打開 http://localhost:4000/

   (5)添加自己的內容

    修改文檔的目錄結構——SUMMARY.md

# 目錄

* [前言](README.md)
* [第一章](Chapter1/README.md)
  * [第1節:first](Chapter1/first.md)
  * [第2節:second](Chapter1/second.md)
* [第二章](Chapter2/README.md)
  * [第1節:first](Chapter2/first.md)
* [第三章](Chapter3/README.md)

    創建SUMMARY.md里的目錄及文件

     添加文檔框架,最核心的文件——book.json

{
    "root": "./",
    "title": "我的文檔",
    "head_title": "_我的文檔",
    "head_description": "我的文檔",
    "head_keywords": "我的文檔",

    "gitbook": ">= 3.0.0",

    "language": "zh-hans",

    "plugins": [
        "-sharing",
        "-fontsettings",
        "-lunr",
        "-search",
        "search-pro",
        "theme-default"
    ]
}

    安裝gitbook依賴

gitbook install

    運行

gitbook serve

要是想修改端口

gitbook serve --port 4001

根目錄會生成_book 文件夾, 里面的內容即為生成的 html 文件

 注:

  如果遇到如下錯誤

 

   問題解決的辦法:

    刪除 .gitbook\versions\3.2.3\lib\output\website\copyPluginAssets.js 的112行

demo

3.docsify

  (1)安裝nodejs

  (2)安裝docsify

npm i docsify-cli -g

  (3)新建docs,進入改目錄初始化

docsify init

自動生成文件

   (4)啟動,測試

docsify serve

 瀏覽器訪問http://localhost:3000

   

  (5)添加自己的內容

    修改index.html

<!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="//unpkg.com/docsify/lib/themes/vue.css">
</head>
<body>
  <div id="app"></div>
  <script>
    window.$docsify = {
      name: '',
      repo: '',
      loadSidebar: true,// 加載側邊欄
      subMaxLevel: 2,
      loadNavbar: true, // 加載導航欄
      search: {
        noData: {
          '/': '沒有結果!'
        },
        paths: 'auto',
        placeholder: {
          '/': '搜索'
        }
      }
    }
  </script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-json.min.js"></script>
  <script src="//unpkg.com/docsify-copy-code"></script>
  <script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
</body>
</html>

  添加_sidebar.md

* 用戶接口

    * [登錄功能](user/)
    * [獲取用戶信息](user/getuserinfo)

* 其他接口

  添加_navbar.md

  添加user/README.md

# 登錄功能

> 總路徑:/v1/user

* 地址:`/login`
* 演示地址:[localhost:8000/v1/user/login?userName=1&passWorld=123](localhost:8000/v1/user/login?userName=1&passWorld=123)
* 請求方式:`POST` [GET 和 POST 均支持,建議使用 POST]
* 請求參數


|字段|說明|是否必須|類型|
|---|---|---|---|
| `userName` |`用戶名`|`Y`|`String`|
| `passWorld` |`密碼`|`Y`|`String`|

* 返回參數 

``` json
{
  "code":"200",
  "msg":"success"
}
```

* 返回字段說明

|返回值字段|字段說明|字段類型|備注|
|---|---|---|---|
|code|狀態碼|String|200 表示請求成功|
|msg|狀態對應的信息|String|有成功失敗等信息|
View Code

  添加user/getuserinfo.md

  刷新瀏覽器

 

  demo


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM