Documentation: Cleanup and code documentation

Cleanup the Sphinx configuration file to comply with PEP8.

Enable the viewcode and autodoc extensions to start adding
code snippets in code.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-11-27 20:02:04 -04:00
parent 2ca38c20b0
commit 21d7ec2428

View File

@@ -13,7 +13,8 @@ from __future__ import unicode_literals
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import sys, os import os
import sys
sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('..'))
@@ -22,7 +23,9 @@ import mayan
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext"))) sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), '_ext'))
)
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
@@ -31,15 +34,14 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext"))
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
#extensions = ["djangodocs", "sphinx.ext.intersphinx"]
extensions = [ extensions = [
'sphinx.ext.extlinks', 'sphinxcontrib.blockdiag', 'sphinxcontrib.spelling' 'sphinx.ext.autodoc', 'sphinx.ext.extlinks', 'sphinxcontrib.blockdiag',
'sphinxcontrib.spelling', 'sphinx.ext.viewcode'
] ]
blockdiag_antialias = True blockdiag_antialias = True
blockdiag_html_image_format = "SVG" blockdiag_html_image_format = 'SVG'
blockdiag_latex_image_format = "PDF" blockdiag_latex_image_format = 'PDF'
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@@ -196,8 +198,10 @@ html_show_sphinx = False
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'MayanEDMS.tex', 'Mayan EDMS Documentation', (
mayan.__author__, 'manual'), 'index', 'MayanEDMS.tex', 'Mayan EDMS Documentation',
mayan.__author__, 'manual'
),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
@@ -223,7 +227,6 @@ latex_documents = [
# If false, no module index is generated. # If false, no module index is generated.
# latex_domain_indices = True # latex_domain_indices = True
# -- Options for manual page output -------------------------------------------- # -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples # One entry per manual page. List of tuples