sphinx使用及其简单配置

php中文网
发布: 2016-06-07 16:30:20
原创
1261人浏览过

一、sphinx使用 进入你要创建文档的目录,例如要创建在目录/home/wwwroot/doc下 cd /home/wwwroot/doc 开始使用向导创建你的文档项目 sphinx-quickstart 程序会提示输入一些选项,如输入根目录,大部分使用默认选项,直接按回车即可。 Enter the root path fo

一、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!

乐彼多用户商城系统LBMall(.net)
乐彼多用户商城系统LBMall(.net)

乐彼多用户商城系统,采用ASP.NET分层技术和AJAX技术,运营于高速稳定的微软.NET+MSSQL 2005平台;完全具备搭建超大型网络购物多用户网上商城的整体技术框架和应用层次LBMall 秉承乐彼软件优秀品质,后台人性化设计,管理窗口识别客户端分辨率自动调整,独立配置的菜单操作锁,使管理操作简单便捷。待办事项1、新订单、支付、付款、短信提醒2、每5分钟自动读取3、新事项声音提醒 店铺管理1

乐彼多用户商城系统LBMall(.net) 0
查看详情 乐彼多用户商城系统LBMall(.net)

二、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
登录后复制

设置主题

找到html_theme = 'default',修改default即可。目前官方提供的主题见sphinx.pocoo.org/theming.html#builtin-themes

其它

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

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

扩展阅读:

  • http://sphinx.pocoo.org/contents.html" target=“_blank”>http://sphinx.pocoo.org/contents.html
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号