**sphinx比較適合為Python生成文檔**
1.安裝sphinx
```shell
pip install sphinx sphinx-autobuild sphinx_rtd_theme
```
2.python文件的注釋
可以注釋如下:
```python
def Method(param1, param2):
"""
This is a reST style.
:param param1: this is a first param
:param param2: this is a second param
:returns: this is a description of what is returned
:raises keyError: raises an exception
"""
```
rst的API文檔關鍵字:
```
param, parameter, arg, argument, key, keyword: Description of a parameter.
type: Type of a parameter. Creates a link if possible.
raises, raise, except, exception: That (and when) a specific exception is raised.
var, ivar, cvar: Description of a variable.
vartype: Type of a variable. Creates a link if possible.
returns, return: Description of the return value.
rtype: Return type. Creates a link if possible.
```
3.生成API文檔
1. 在代碼文件夾中建立:docs文件夾
2. 在docs文件夾運行`sphinx-quickstart`, 在之后的選項中autodoc設為y
3. 編輯`conf.py`.
```python
import os
import sys
sys.path.insert(0, os.path.abspath('../')) #設置根目錄
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
```
4. 運行`sphinx-apidoc -o ./ ../`
5. `make html`
6. 在_build中會有生成的html文件
- Welcome
- fzf使用
- git回滾
- 安裝gollum使用github作為wiki端
- 使用github的issue
- linux的腳本
- git沖突解決
- sphinx生成python文檔
- 使用aria2作為下載客戶端
- tmux使用
- anaconda的虛擬環境構建
- git commit message
- tensorflow指定GPU,限制顯存
- pycharm professional
- 好用的命令行工具
- lrzsz使用
- 使用iTerm2的profile免密登陸遠程主機
- quicklook 插件
- docker基本使用
- jupyter notebook轉html和pdf
- jupyter-notebook幾個有用命令
- mongodb安裝
- pytorch載入與訓練模型
- git覆蓋分支
- Jetson TX2資源
- GitHub上fork的repo和上游分支保持一致的方法
- vscode調試前端代碼
- github hosts
- git添加遠程倉庫
- 其它語言好用的庫/包
- git強制拉取和強制提交
- chrome擴展發布
- mac的CPP lib
- vscode遠程