sphinx使用及其簡(jiǎn)單配置方法
進(jìn)入你要?jiǎng)?chuàng)建文檔的目錄,例如要?jiǎng)?chuàng)建在目錄/home/wwwroot/doc下
cd /home/wwwroot/doc
開(kāi)始使用向?qū)?chuàng)建你的文檔項(xiàng)目
sphinx-quickstart
程序會(huì)提示輸入一些選項(xiàng),如輸入根目錄,大部分使用默認(rèn)選項(xiàng),直接按回車(chē)即可。
Enter the root path for documentation.
> Root path for the documentation [.]:
//輸入跟目錄,直接回車(chē)
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 [_]:
//直接回車(chē)
The project name will occur in several places in the built documentation.
> Project name: F2E Cookbook
> Author name(s): imbingdian
//輸入項(xiàng)目名稱
//輸入作者名稱
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
//檔文件的擴(kuò)展名,默認(rèn)是.rst
//后面的操作基本回車(chē)就好
完成后可以看到doc文件中生了以下目錄文件
build--生成文檔目錄
source--源文件目錄
make.bat
makefile
生成html文檔
make html
看一下build目錄下是不是生成了html文檔了?
^_^ enjoy it!
查看demo:http://doc.litejs.com/
sphinx簡(jiǎn)單配置
source目錄下的conf.py文件為sphinx的配置文件。
1)修改文檔語(yǔ)言為中文:
找到#language = None,修改為:language ='zh_CN',其它語(yǔ)言見(jiàn)下表
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)設(shè)置主題
找到html_theme = 'default',修改default即可。目前官方提供的主題見(jiàn)http://sphinx.pocoo.org/theming.html#builtin-themes
3)其它
還其它更多設(shè)置,具體請(qǐng)參考官方文檔。
設(shè)置好以后,重新make html即可。
擴(kuò)展閱讀:
相關(guān)文章
centos redhat系列對(duì)抗ddos之居家必備利器 banip.txt
本文可以用于redhat centos 系列 linux 系統(tǒng)的 屏蔽多連接ip,具有抗ddos功能的代碼。2010-11-11linux系統(tǒng)Ansible自動(dòng)化運(yùn)維部署方法
在本篇文章里小編給大家整理了關(guān)于linux系統(tǒng)Ansible自動(dòng)化運(yùn)維部署方法以及知識(shí)點(diǎn)總結(jié),需要的朋友們參考下。2019-06-06Linux VPS備份教程 手動(dòng)備份網(wǎng)站數(shù)據(jù)
老左其實(shí)也比較贊同不是所有的網(wǎng)站都需要采用自動(dòng)備份,每天都自動(dòng)備份也感覺(jué)沒(méi)有必要,除非我們的網(wǎng)站非常的重要2012-09-09.htaccess rewrite 規(guī)則詳細(xì)說(shuō)明
用Apache虛擬主機(jī)的朋友很多,apache提供的.htaccess模塊可以為每個(gè)虛擬主機(jī)設(shè)定rewrite規(guī)則,這對(duì)網(wǎng)站SEO優(yōu)化相當(dāng)有用,同時(shí)也改善了用戶體驗(yàn)2016-04-04Win10 + Ubuntu 16.04雙系統(tǒng)完美安裝教程【詳細(xì)】
這篇文章主要介紹了Win10 + Ubuntu 16.04雙系統(tǒng)完美安裝教程,本文圖文并茂給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-10-10VirtualBox 未指定要bridged的網(wǎng)絡(luò)界面的解決辦法
這篇文章主要介紹了VirtualBox 未指定要bridged的網(wǎng)絡(luò)界面的解決辦法的相關(guān)資料,希望通過(guò)本文能幫助到大家,讓大家解決遇到這樣的問(wèn)題,需要的朋友可以參考下2017-10-10關(guān)于linux服務(wù)器下vsftpd的一些問(wèn)題
針對(duì)我自己本身出現(xiàn)的問(wèn)題,將高人與我的QQ聊天記錄整理了一份,然后再加上實(shí)際的操作.終于讓我大徹大悟.現(xiàn)在與大家狠狠的分享這位高人的成果.2010-06-06