First on
Details
First, you need to know what restructuredtext is and can be understood as something similar to markdown.
And then
- Install, pip install Sphinx
- Enter the directory where the document is stored, on the command line, Sphinx-quickstart, enter as needed, generate a bunch of things, including conf.py and make, etc.
- Modify conf.py as needed
- Write an RST file, such as the default Index.rst or a linked rst file.
- On the command line, make HTML
The effect is to use a theme called Sphinx_bootstrap_theme. (PS. There are many themes to choose from)
The configuration for this topic in conf.py is to add the following lines of code
Import sphinx_bootstrap_themehtml_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 ':" ", ' bootstrap_version ':" 3 ",}
The folder layout of the generated document
The Index.rst file in the diagram
Welcome to Sandglass ' s documentation!===================================== installation------------ pip install Sandglass Overview--------**sandglass (Hourglass) * * is an enhanced, friendly time-processing library designed to liberate programmer productivity. There are too many libraries for processing time in Python, Datetime/date/time/calendar, and so on. Need to remember too much detail, choose difficult. And Sandglass is the solution to this penicillin. Free from all kinds of trouble-changing. Just remember **sandglass objects * * and **ben () * *, **tslice () * *, **cronwalk () * * These are the main APIs. Features----------+ API concise, out-of-the-box + Enhanced takeover DateTime + (this omission xx word) quickly get started---------in Sandglass, the core object is the **sandglass object * *. With this object, you can easily get the various time attributes and actions:: #获取属性 >>>sg = Ben (' 2013,1,1 13:14:15 ') >>>sg.year, Sg.month,sg.day,sg.hour,sg.minute,sg.second,sg.microsecond (1, 1, 0) (this omission of xx words) API Documentation-----------------.. Toctree::: maxdepth:2 Apitodo---------* Add timezone supportchangelog---------**0.0.1*** Initial Releaseindices and tables==================*: Ref: ' Genindex ' *: Ref: ' Modindex ' *: Ref: ' Search '
See Sphinx's official documentation for more details.
and Sphinx-bootstrap-theme the official document of the subject.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Use Sphinx to generate beautiful documents