sphinx使用及其简单配置方法_Linux

sphinx使用
进入你要创建文档的目录,例如要创建在目录/home/wwwroot/doc下
cd /home/wwwroot/doc
开始使用向导创建你的文档项目
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:http://doc.litejs.com/
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即可。目前官方提供的主题见http://sphinx.pocoo.org/theming.html

3)其它

还其它更多设置,具体请参考官方文档。

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

扩展阅读:

  • http://sphinx.pocoo.org/contents.html
    http://blog.s135.com/read.php?360
时间: 2024-09-17 03:53:59

sphinx使用及其简单配置方法_Linux的相关文章

Apache本地二级域名配置方法_Linux

本文讲述了Apache本地二级域名配置方法.分享给大家供大家参考,具体如下: 我们在本地调试web程序时,常有很多不同的项目.不同的项目,我们希望使用不同的文件夹和不同的域名. 比如今天我正在建设一个鲜花网站,可是有个客户临时要做一个简单的卖眼镜的网站,两个网站在电脑上放在不同的目录下,而且要使用两个不同的域名来访问.一个是flower.domain.com,一个是glass.domain.com. 通常情况下,我们应该这么做: 1.在本地hosts文件中,将flower.domain.com指

Ubuntu下Telnet服务器的配置方法_Linux

1. 首先介绍linux中的守护进程 在Linux系统中有一个特殊的守护进程inetd(InterNET services Daemon),它用于Internet标准服务,通常在系统启动时启动.通过命令行可以给出inetd的配置文件,该配置文件列出了inetd所提供的服务清单.如果没有在命令行给出配置文件,那么inetd将从文件/etc/inetd.conf中读取它的配置信息.inetd的主要任务是为那些没有在系统初始化时启动的服务器进程监听请求,它在同配置文件中列出的服务相关联的TCP或UDP

Apache同时支持PHP和Python的配置方法_Linux

最近开始学着用Python+Tornado+MongoDB写网站,兴起写了一个博客,觉得很有意思所以想挂在服务器上发布出去找大家一起玩.这个时候就遇到了问题. 服务器是windows系统,安装的是Apache,所以需要配置Apache,使Apache同时支持PHP和Python. 废话少说,提供有效方案一个,照做即可: 1. 修改 httpd.conf 文件 将下列几个Module前的注释符 # 去掉 LoadModule proxy_module modules/mod_proxy.so Lo

linux并发连接50万的配置方法_Linux

- A 64 bits hardware/kernel (AMD64, Opterons)  - At least 8GB of ram  - A recent linux kernel (2.6.x)  About tuning, I prefer to not fully disclose them because servers are targets of many attacks, so it's better not help hackers.  The most touchy th

Apache 安全配置方法_Linux

令Apache占领Web服务器半壁江山的一个重要原因就是它可以提供一个安全的Web操作环境.Apache团体为保证其安全性做了大量的工作.想当年,在此产品被发现存在一个安全缺陷时,Apache的开发人员就尽快地搞出了一个补丁. 然而,即管Apache已经堪称安全的产品,如果你在构建你的服务器时没有采取一些安全预防措施,这种Web服务器仍易于受到很多攻击. 在本文中,笔者将为你提供10个技巧,借此你可以保护自己的Apache Web服务器免于受到许多攻击.不过,必须谨记,你需要仔细地评估每一个技巧

Linux下用dnsmasq做dns cache server的配置方法_Linux

目前最新版是2.7.1 ,可去其FTP下载:http://www.thekelleys.org.uk/dnsmasq/ 安装过程比较简单 yum -y install dnsmasq* wget http://www.keepalived.org/software/keepalived-1.2.9.tar.gz tar zxvf keepalived-1.2.9.tar.gz cd keepalived-1.2.9 ./configure --prefix=/usr/local/keepaliv

CentOS+Nginx+PHP+MySQL标准生产环境配置方法_Linux

PHP 5.3.1 MySQL 5.0.89 Nginx 0.8.33 或 0.7.65 (可选) 这个可比网上流传的什么一键安装包要好得多,强烈推荐此法安装,适合所有菜鸟和高手.我服务器上全用的源代码编译安装,也好不到哪去,还很费劲.我这个装完已经包含 php 的一些常用扩展, PDO,eaccelerator,memcache,tidy等等. CentOS 最小化安装,然后先新建一个 repo # vi /etc/yum.repos.d/centos.21andy.com.repo 放入如下

apache 虚拟主机的配置方法_Linux

方法一: 首先打开apache中conf下的http.conf文件打开虚拟主机的注释:如下去掉第二行前面的#即可 # Virtual hosts # Include conf/extra/httpd-vhosts.conf 再打开conf目录下的extra目录中的httpd-vhosts.conf文件 在文件最后面加上 <VirtualHost *:80>//你的虚拟主机所使用的端口号 ServerAdmin webmaster@dummy-host2.localhost //虚拟主机的管理员

用cwrsync同步windows下数据的简单配置方法_win服务器

cwrsync下载地址 http://sourceforge.net/projects/sereds/files/cwRsync 或者到 s.jb51.net下载 cwrsync分客户端和服务端两部分,拿cwrsync 4.0.版来说,分别对应cwRsync_4.0.5_Installer.zip和cwRsyncServer_4.0.5_Installer.zip 安装: 客户端安装比较简单,一直下一步就可以了. 服务端安装到Service Account这一步的时候,这一步会建立cwrsync