Adding documentation framework

This adds documentation framework for Bandit. To build the new
documentation you can use the new tox target:

  tox -e docs

This will spit out various formatted output into the docs/build
folder.

Change-Id: I3497e26052021900ad55ecdd2517198b22e82f0e
Partial-Bug: 1474796
This commit is contained in:
Tim Kelsey 2015-07-24 12:53:29 +01:00
parent 20c12cde76
commit 42f3e2961a
13 changed files with 91 additions and 0 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ venv*
build/*
cover/*
.cover
docs/build/*

76
docs/source/conf.py Executable file
View File

@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
# 'sphinx.ext.intersphinx',
'oslosphinx'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Bandit'
copyright = u'2015, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."]
# html_theme = '_theme'
# html_static_path = ['static']
html_theme_options = {}
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.
# intersphinx_mapping = {'http://docs.python.org/': None}

2
docs/source/index.rst Normal file
View File

@ -0,0 +1,2 @@
Bandit Documentation
====================

View File

@ -119,3 +119,8 @@ package_data =
data_files =
bandit =
share/bandit/wordlist/ = wordlist/default-passwords
[build_sphinx]
all_files = 1
build-dir = docs/build
source-dir = docs/source

View File

@ -7,3 +7,6 @@ python-subunit>=0.0.18
testrepository>=0.0.18
testscenarios>=0.4
testtools>=0.9.36,!=1.2.0
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
oslosphinx>=2.5.0 # Apache-2.0

View File

@ -26,6 +26,10 @@ deps = PyYAML>=3.1.0
requests>=2.7.0
commands = python tools/openstack_coverage.py
[testenv:docs]
commands=
python setup.py build_sphinx
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# H303 no wild card imports