首先,需要知道什么是restructuredtext。可以理解为相似于markdown的一个东西。html
而后python
上图的效果,是使用了一个主题叫sphinx_bootstrap_theme。bootstrap
(PS.有很是多主题可以选择)api
conf.py中关于这个主题的配置是加了如下几行代码markdown
import sphinx_bootstrap_theme html_theme = 'bootstrap' html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() html_theme_options = { 'navbar_title': "Sandglass", 'globaltoc_depth': 2, 'globaltoc_includehidden': "true", 'navbar_class': "navbar navbar-inverse", 'navbar_fixed_top': "true", 'bootswatch_theme': "united", 'bootstrap_version': "3", }
生成的文档的目录布局布局
图中的index.rst文件ui
Welcome to sandglass's documentation! ===================================== 安装 ------------ pip install sandglass 概览 -------- **sandglass(沙漏)** 是一个加强的、友好的时间处理库。目的是为了解放程序猿的生产力。在python中有太多处理时间的库,datetime/date/time/calendar等等。需要记的细节太多,选择困难。 而sandglass就是解决这个的青霉素。从各类麻烦的转换中解脱出来。spa
仅仅需记住 **Sandglass对象** 和 **ben()** 、 **tslice()** 、 **cronwalk()** 这几个基本的api就能够。命令行
特性 ---------- + api简洁。开箱即用 + 加强接管datetime + (这次略去xx字) 高速上手 --------- 在sandglass中,核心对象是 **Sandglass对象** 。经过这个对象。可以方便的获取各个时间属性和操做:: #获取属性 >>>sg = ben('2013,1,1 13:14:15') >>>sg.year,sg.month,sg.day,sg.hour,sg.minute,sg.second,sg.microsecond (2013, 1, 1, 13, 14, 15, 0) (这次略去xx字) API文档 ----------------- .. toctree:: :maxdepth: 2 api Todo --------- * Add timezone support Changelog --------- **0.0.1** * Initial release Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` rest
不少其它详情请看sphinx的官方文档。