Use Sphinx to generate beautiful documents

Source: Internet
Author: User

First on


Details

First, you need to know what restructuredtext is and can be understood as something similar to markdown.

And then

  1. Install, pip install Sphinx
  2. 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.
  3. Modify conf.py as needed
  4. Write an RST file, such as the default Index.rst or a linked rst file.
  5. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.