Documentation Tool - nsu-loop/nsu-loop-application GitHub Wiki

We will use Sphinx as our project's documentation tool.

Usage of Sphinx:

Sphinx is a feature-packed documentation generator that was originally created for Python. This tool makes it simple to create intelligent and easy-to-understand documentation. It translates a set of plain text source files into various output formats, automatically producing cross-references, indices, etc. Sphinx can generate a series of HTML files, a PDF file (via LaTeX), and much more from a directory containing a bunch of markdown documents.

How to install Sphinx?

On Windows, you should open Command Prompt and run the below command.

pip install -U sphinx

Please refer to this Installation Process

Commenting using Sphinx:

For class:

"""
This class contains...........
This class functionality is.......
"""

For method:

"""
This method functionality is......

:param name: ...... - param functionality
:param type: .....
:return: ........
"""     

Example:

def post_comment_create_and_list_view(request):

"""
This method will create a post request on two separate forms post form and comment form and upon successfull insertion,

it will update the form and will show in the post content or comment body.

This method will only load this page if the user is logged in.

   
:param name: request - used to generate responses(Http) depending on the request that it receives

:param type: HttpResponse

:return: returns posts page

"""

qs = Post.objects.all()

profile = Profile.objects.get(user=request.user)

If you want to read more:

Please refer to Sphinx's Official Documentation