Creating documentation with Sphinx

This week I worked on creating documetation and creating a web crawler for my new feature of providing users with option of installing packages from PythonLibs.

It’s really a great tool for creating docs. In just few steps I could create docs as compared to creating a whole website based on django or using static webpages on github.

We can create docs in few steps :

  1. mkdir docs
  2. Go to docs directory and run
    sphinx-quickstart
  3. Navigate to
    docs/source/conf.py

    and change :

    sys.path.insert(0, os.path.abspath('../..'))
  4. Now run
    sphinx-apidoc -f -o source/ ../mypackage/
  5. Our directory structure should be like this :
    myproject/
    |-- README
    |-- setup.py
    |-- myvirtualenv/
    |-- mypackage/
    |   |-- __init__.py
    |   `-- mymodule.py
    `-- docs/
        |-- MakeFile
        |-- build/
        `-- source/
    
  6. Finally run the following command to create html files from .rst files
    make html

We can also play with MakeFile to configure the settings based on our preference.

Advertisements

Author: scorpiocoder

I am a 3rd year, IIIT-Chittoor student enthusiastic and confused about various software technologies : Python, Machine Learning, Networks, Natural Language Processing and Android Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s