国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Web服務器 > 正文

sphinx使用及其簡單配置方法

2024-09-01 13:45:33
字體:
來源:轉載
供稿:網(wǎng)友
sphinx使用
進入你要創(chuàng)建文檔的目錄,例如要創(chuàng)建在目錄/home/wwwroot/doc下
cd /home/wwwroot/doc
開始使用向導創(chuàng)建你的文檔項目
sphinx-quickstart
程序會提示輸入一些選項,如輸入根目錄,大部分使用默認選項,直接按回車即可。

復制代碼 代碼如下:


Enter the root path for documentation.
> Root path for the documentation [.]:
//輸入跟目錄,直接回車
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/N) [n]:
//是否分離source和build目錄,建議選y,方便管理
Inside the root directory, two more directories will be created; "_templates"
for custom HTML templates and "_static" for custom stylesheets and other static
files. You can enter another prefix (such as ".") to replace the underscore.
> Name prefix for templates and static dir [_]:
//直接回車
The project name will occur in several places in the built documentation.
> Project name: F2E Cookbook
> Author name(s): imbingdian
//輸入項目名稱
//輸入作者名稱
The file name suffix for source files. Commonly, this is either ".txt"
or ".rst". Only files with this suffix are considered documents.
> Source file suffix [.rst]: .txt
//檔文件的擴展名,默認是.rst
//后面的操作基本回車就好


完成后可以看到doc文件中生了以下目錄文件
build--生成文檔目錄
source--源文件目錄
make.bat
makefile
生成html文檔
make html
看一下build目錄下是不是生成了html文檔了?
^_^ enjoy it!
查看demo:
sphinx簡單配置
source目錄下的conf.py文件為sphinx的配置文件。
1)修改文檔語言為中文:
找到#language = None,修改為:language ='zh_CN',其它語言見下表

復制代碼 代碼如下:


bn – Bengali
ca – Catalan
cs – Czech
da – Danish
de – German
en – English
es – Spanish
fi – Finnish
fr – French
hr – Croatian
it – Italian
ja – Japanese
lt – Lithuanian
nl – Dutch
pl – Polish
pt_BR – Brazilian Portuguese
ru – Russian
sl – Slovenian
tr – Turkish
uk_UA – Ukrainian
zh_CN – Simplified Chinese
zh_TW – Traditional Chinese


2)設置主題

找到html_theme = 'default',修改default即可。目前官方提供的主題見

3)其它

還其它更多設置,具體請參考官方文檔。

設置好以后,重新make html即可。

擴展閱讀:


  • ?360
  • 發(fā)表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發(fā)表
    主站蜘蛛池模板: 前郭尔| 阿克陶县| 宜川县| 左云县| 兰考县| 西林县| 沈丘县| 且末县| 醴陵市| 达日县| 东兰县| 东乌| 唐山市| 临漳县| 沙河市| 巧家县| 漠河县| 新和县| 宜昌市| 读书| 长乐市| 临武县| 兴安县| 德令哈市| 洪泽县| 新郑市| 抚州市| 伊金霍洛旗| 开封市| 芦溪县| 婺源县| 扬州市| 通化县| 防城港市| 潢川县| 博客| 峨眉山市| 西华县| 漠河县| 抚顺县| 彭阳县|