亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專(zhuān)欄INFORMATION COLUMN

文檔生成器 mkdocs

hosition / 2938人閱讀

摘要:是一個(gè)對(duì)非常友好的文檔生成器,中文文檔地址使用我們可以用編寫(xiě)自己的文檔,而且可以免費(fèi)部署到。資源中文數(shù)據(jù)結(jié)構(gòu)和算法教程類(lèi)似生成文檔工具入坑指南配置文檔查詢(xún)工具支持?jǐn)?shù)學(xué)公式配置多個(gè)公眾號(hào)蘇生不惑

mkdocs 是 Python 一個(gè)對(duì) Markdown 非常友好的文檔生成器,中文文檔地址

使用 mkdocs 我們可以用md 編寫(xiě)自己的文檔,而且可以免費(fèi)部署到 GitHub 。

安裝

pip install mkdocs

使用
λ mkdocs.exe new mydoc
INFO    -  Creating project directory: mydoc
INFO    -  Writing config file: mydocmkdocs.yml
INFO    -  Writing initial docs: mydocdocsindex.md
λ cd mydoc

d:codemydoc
λ ls
docs/  mkdocs.yml

d:codemydoc
λ mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
[I 190528 20:32:49 server:296] Serving on http://127.0.0.1:8000
[I 190528 20:32:49 handlers:62] Start watching changes
[I 190528 20:32:49 handlers:64] Start detecting changes
[I 190528 20:33:06 handlers:135] Browser Connected: http://127.0.0.1:8000/

編輯

vi docs/index.md
把 command 改為中文 命令 記得把文件改為 utf8 編碼,否則

INFO    -  Building documentation...
ERROR   -  Encoding error reading file: index.md
ERROR   -  Error reading page "index.md": "utf-8" codec can"t decode byte 0xc3 in position 92: invalid continuation byte
[E 190528 20:38:45 ioloop:801] Exception in callback >

刷新看到效果

vi mkdocs.yml
把site_name 的 my docs 改為中文 我的文檔

添加頁(yè)面

vi about.md
vi mkdocs.yml

site_name: 文檔
pages:
- [index.md, Home]
- [about.md, About]

然后報(bào)錯(cuò)了

INFO    -  Building documentation...
ERROR   -  Config value: "pages". Error: Invalid pages config. {} {, }
[E 190529 09:57:45 ioloop:801] Exception in callback >
    Traceback (most recent call last):
      File "d:pythonlibsite-packages	ornadoioloop.py", line 1229, in _run
        return self.callback()
      File "d:pythonlibsite-packageslivereloadhandlers.py", line 69, in poll_tasks
        filepath, delay = cls.watcher.examine()
      File "d:pythonlibsite-packageslivereloadwatcher.py", line 105, in examine
        func()
      File "d:pythonlibsite-packagesmkdocscommandsserve.py", line 107, in builder
        site_dir=site_dir
      File "d:pythonlibsite-packagesmkdocsconfigase.py", line 210, in load_config
        "Aborted with {0} Configuration Errors!".format(len(errors))
    mkdocs.exceptions.ConfigurationError: Aborted with 1 Configuration Errors!
λ mkdocs -V
mkdocs, version 1.0.4 from d:pythonlibsite-packagesmkdocs (Python 3.7)

查找到issue https://github.com/mkdocs/mkd...
https://www.mkdocs.org/user-g...
改為

site_name: 我的文檔
nav:
- 主頁(yè): "index.md"
- 關(guān)于: "about.md"
theme: readthedocs

https://markdown-docs-zh.readthedocs.io/zh_CN/latest/

原來(lái)是中文文檔過(guò)時(shí)了。

生成秘鑰

cd ~/.ssh
ssh-keygen -t rsa -C “mysusheng@gmail.com”
這里不要一路回車(chē),我們自己手動(dòng)填寫(xiě)保存路徑
vi config

Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/mysusheng
λ ssh -T git@github.com
Hi sushengbuhuo! You"ve successfully authenticated, but GitHub does not provide shell access.
站點(diǎn)生成
λ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: d:codemydocsite

d:codemydoc
λ ls
docs/  mkdocs.yml  site/

一段時(shí)間后, 可能有文件被從源碼中移除了, 但是相關(guān)的文檔仍殘留在 site 目錄中. 在構(gòu)建命令中添加 --clean 參數(shù)即可移除這些文檔.

$ mkdocs build --clean

λ cd site

d:codemydocsite
λ ls
404.html  css/    img/        js/      search.html  sitemap.xml.gz
about/    fonts/  index.html  search/  sitemap.xml

d:codemydocsite
λ php -S localhost:8000
PHP 7.1.13 Development Server started at Wed May 29 10:17:19 2019
Listening on http://localhost:8000
部署到GitHub
λ git clone https://github.com/sushengbuhuo/markdown_doc
Cloning into "markdown_doc"...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.

d:code
λ cd markdown_doc

d:codemarkdown_doc (master)
λ ls
README.md

d:codemarkdown_doc (master)
λ mkdir docs

d:codemarkdown_doc (master)
λ cd docs

d:codemarkdown_docdocs (master)
λ mkdocs.exe new .
INFO    -  Writing config file: .mkdocs.yml
INFO    -  Writing initial docs: .docsindex.md

d:codemarkdown_docdocs (master)
λ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: d:codemarkdown_docdocssite

d:codemarkdown_docdocs (master)
λ echo "site/" >> .gitignore

d:codemarkdown_docdocs (master)
λ mkdocs gh-deploy --clean
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: d:codemarkdown_docdocssite
WARNING -  Version check skipped: No version specificed in previous deployment.
INFO    -  Copying "d:codemarkdown_docdocssite" to "gh-pages" branch and pushing to GitHub.
INFO    -  Your documentation should shortly be available at: https://sushengbuhuo.github.io/markdown_doc/

就是把site目錄代碼上傳到github gh-pages分支了.

瀏覽器訪問(wèn) https://sushengbuhuo.github.i... 看到效果了。

資源

Python 中文數(shù)據(jù)結(jié)構(gòu)和算法教程
類(lèi)似gitbook生成文檔工具
Python Web 入坑指南
mkdocs配置
文檔查詢(xún)工具
支持?jǐn)?shù)學(xué)公式
git配置多個(gè)SSH Key

公眾號(hào):蘇生不惑

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/43938.html

相關(guān)文章

  • 不同用戶python path 權(quán)限問(wèn)題

    摘要:?jiǎn)栴}背景用戶可以運(yùn)行但運(yùn)行則下列錯(cuò)誤經(jīng)過(guò)排查,發(fā)現(xiàn)是在某些的權(quán)限問(wèn)題解決方法查看使用的代碼可知,使用的是查看路徑切換到用戶然后在命令行運(yùn)行路徑的權(quán)限修改路徑的權(quán)限發(fā)現(xiàn)有寫(xiě)目錄是沒(méi)有執(zhí)行權(quán)限的。 問(wèn)題背景 root 用戶可以運(yùn)行pip install mkdocs但gitlab-runner 運(yùn)行pip install mkdocs 則下列錯(cuò)誤 pip install mkdocs Tr...

    dack 評(píng)論0 收藏0
  • 蠎周刊 2015 年度最贊

    摘要:蠎周刊年度最贊親俺們又來(lái)回顧又一個(gè)偉大的年份兒包去年最受歡迎的文章和項(xiàng)目如果你錯(cuò)過(guò)了幾期就這一期不會(huì)丟失最好的嗯哼還為你和你的準(zhǔn)備了一批紀(jì)念裇從這兒獲取任何時(shí)候如果想分享好物給大家在這兒提交喜歡我們收集的任何意見(jiàn)建議通過(guò)來(lái)吧原文 Title: 蠎周刊 2015 年度最贊Date: 2016-01-09 Tags: Weekly,Pycoder,Zh Slug: issue-198-to...

    young.li 評(píng)論0 收藏0
  • 終于不用再苦逼地寫(xiě)文檔了!教你如何生成可調(diào)試的API文檔

    摘要:本文寫(xiě)的是什么平時(shí)總要寫(xiě)文檔。所以,我所希望的事,就是在完成代碼后,可以費(fèi)很少的力氣,就生成一個(gè)像上文中所說(shuō)的可調(diào)試文檔。我們接下來(lái)要做兩件事生成文檔文檔是可調(diào)試的文檔。一句話流程點(diǎn)擊生成按鈕,生成類(lèi)的文檔。 本文寫(xiě)的是什么? 平時(shí)總要寫(xiě)文檔。不寫(xiě),代碼無(wú)法維護(hù),所以不得不寫(xiě)。但是寫(xiě)文檔費(fèi)時(shí)費(fèi)力,更可怕的是寫(xiě)完了讀起來(lái)還很費(fèi)勁,束之高閣,總感覺(jué)時(shí)間浪費(fèi)掉了,真是苦不堪言。 一直以來(lái)深受...

    SegmentFault 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

閱讀需要支付1元查看
<