docsify 使用記錄

docsify 中文使用教程: https://docsify.js.org/#/zh-cn/cover
docsify chat: https://gitter.im/docsifyjs/Lobby
https://github.com/docsifyjs/docsify-cli

docsif介紹

  docsify是一個文檔網站生成工具(md轉html 類似於gitbook)。docsify 是一個動態生成文檔網站的工具。不同於 GitBook、Hexo 的地方是它不會生成將 .md 轉成 .html 文件,所有轉換工作都是在運行時進行。如果只是需要快速的搭建一個小型的文檔網站,或者不想因爲生成的一堆 .html 文件“污染” commit 記錄,只需要創建一個 index.html 就可以開始寫文檔。

使用docsify 的文檔項目:
https://github.com/docsifyjs/awesome-docsify#showcase

特性

  • 無需構建,寫完文檔直接發佈
  • 容易使用並且輕量 (~19kB gzipped)
  • 智能的全文搜索
  • 提供多套主題
  • 豐富的 API
  • 支持 Emoji
  • 兼容 IE10+
  • 支持 SSR (example)

使用docsify

效果:http://118.25.63.144
全部代碼在:https://gitee.com/yaoxin001/Blog

  使用方式,你可以安裝npm工具來完成docsify的部署和配置。但是我感覺那樣很麻煩,而且npm的各種版本對應就是個大坑。你其實只需要一個index.html就可以實現文檔網站生成。啓動一個靜態服務器直接用python就可以,或者Nginx

cd Blog && python -m SimpleHTTPServer 3000 // python2
cd Blog && python -m http.seriver 3000 // python3

  使用docsify需要幾個文件,index.html、_coverpage.md、_sidebar.md、README.md。
index.html  用來調外部js解析md文檔
README.md  是首頁
_coverpage.md  是封面
_sidebar.md  是左側導航欄

(base) yx@yx-PC:~$ tree Documents/Gitee/Blog/
Documents/Gitee/Blog/
├── bg.png
├── blog
├── _coverpage.md
├── icon.jpg
├── index.html
├── README.md
├── server.py
├── _sidebar.md
├── Study-VTK.md
└── SUMMARY.md

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/buble.css">
</head>
<body>
  <div id="app"></div>
  <script>
    window.$docsify = {
      coverpage: true,
      loadSidebar: true,
      subMaxLevel: 2
    }
  </script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</body>
</html>

README.md

# 介紹
&emsp;&emsp;估計這是一個只有自己訪問的網址導航工具吧。

_coverpage.md

![logo](icon.jpg)

# Beyond欣 's Blog Navigation
> 人最怕安逸,追求什麼也別追求安逸
* 
[百度](https://www.baidu.com/)
[翻譯](https://fanyi.baidu.com/?aldtype=16047#auto/zh/)
[阿里郵箱](http://mail.hichina.com/)
[CSDN](https://blog.csdn.net/a15005784320)
[gitee](https://gitee.com/yaoxin001)  
[Get Started](#介紹)

_sidebar.md

* [介紹]()
* [Study-VTK](Study-VTK)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章