文档利器reStructuredText
关于为啥要用reStructuredText,这个不用多说,方便,简洁。单从Python和Django的官网文档就是用reStructuredText来编写的,就可以看出这是一把利器。 reStructuredText(简写rst)能够转换的格式很多,包括html、xml、pdf及Latex等。 一开始在windows下使用rst来编写,采用vim编辑器,可以装一个rst的插件vst.vim,可以提供语法高亮等功能。 但是使用:Vst html转换成html文件,格式不够漂亮,后来网上搜到sphinx,能够生成格式漂亮的html。 于是转到ubuntu下,使用sphinx。 关于rst的编写规范,网上资料挺多,可以参考 http://wiki.venj.me/restructuredtext-quick-reference#jieshi 编写一个简单的rst文件,示例如下。
文章图片
ubuntu下使用sphinx,只需要安装python-sphinx包即可 root@archer:/home/archer# apt-get install python-sphinx 安装后,就可以使用sphinx-quickstart命令来使用了,先建一个目录,然后进入目录执行sphinx-quickstart(注意要root权限) root@archer:/home/archer# mkdir use_rst root@archer:/home/archer# cd use_rst root@archer:/home/archer/use_rst# sphinx-quickstart 执行过程中会让设置一些东西,只管一路enter,遇到Project Name、Author Name(s)、Project Version、Project Release时自己填一下
文章图片
执行完后目录下生成一些文件
文章图片
然后make html root@archer:/home/archer/use_rst# make html 执行成功后在_build/html下生成了对应的html文件,使用浏览器访问可以看到效果。
文章图片
推荐阅读
- ts泛型使用举例
- P5 DS——构件与文档关联
- LaTeX记录|LaTeX记录 —— LaTeX文档基本结构
- android|android today上下卡片,【精品文档】关于计算机专业大学生安卓系统有关的外文文献翻译成品(基于Android(安卓)的考勤管理系统(中英文双语对照)
- 《DOM知识点总结》
- BLAS|BLAS API 中文文档(2)(待续)
- 用c#转换word或excel文档为html文件|用c#转换word或excel文档为html文件,C#实现DataSet内数据转化为Excel和Word文件的通用类完整实例...
- elasticsearch分析器
- 《10大利器帮你改变工作方式》学习心得
- 第六课|第六课 js管理页面元素位置大小