Merge "Add a script to generate a Sphinx dashboard documentation"

This commit is contained in:
Jenkins 2014-11-07 15:01:31 +00:00 committed by Gerrit Code Review
commit e604435c9d
6 changed files with 60 additions and 5 deletions

2
.gitignore vendored
View File

@ -22,3 +22,5 @@ ChangeLog
*~ *~
.*.swp .*.swp
.bak .bak
doc/dashboards/

View File

@ -1,3 +1,7 @@
============
Contributing
============
If you would like to contribute to the development of OpenStack, If you would like to contribute to the development of OpenStack,
you must follow the steps in the "If you're a developer, start here" you must follow the steps in the "If you're a developer, start here"
section of this page: section of this page:

View File

@ -1,4 +1 @@
============
Contributing
============
.. include:: ../../CONTRIBUTING.rst .. include:: ../../CONTRIBUTING.rst

View File

@ -1,5 +1,5 @@
`{{ title }}`_ `{{ title }}`_
========================== ==============================================================================
{% if description %} {% if description %}
Description:: Description::

46
tools/generate_dashboards.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# 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.
output_directory=doc/dashboards/
if [[ -e $output_directory ]]; then
rm -f $output_directory/*
else
mkdir -p $output_directory
fi
cp doc/source/conf.py $output_directory
echo "
html_theme_options = {
'nosidebar': True
}" >> $output_directory/conf.py
for dashboard in $(find dashboards -name '*.dash' | sort); do
output=$(basename $dashboard .dash)
python gerrit_dash_creator/cmd/creator.py --template-directory templates \
--template single.rst $dashboard > $output_directory/dashboard_$output.rst
done
echo "===========================
OpenStack Gerrit Dashboards
===========================
.. toctree::
" >> $output_directory/index.rst
for dashboard in $(find $output_directory -name 'dashboard_*.rst' | sort); do
dashboard=$(basename $dashboard .rst)
echo " " $dashboard >> $output_directory/index.rst
done

View File

@ -1,6 +1,6 @@
[tox] [tox]
minversion = 1.6 minversion = 1.6
envlist = py33,py34,py26,py27,pypy,pep8,checksyntax envlist = py33,py34,py26,py27,pypy,pep8,checksyntax,dashboards
skipsdist = True skipsdist = True
[testenv] [testenv]
@ -10,6 +10,7 @@ setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
[testenv:pep8] [testenv:pep8]
commands = flake8 commands = flake8
@ -36,3 +37,8 @@ show-source = True
ignore = E123,E125,H803 ignore = E123,E125,H803
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:dashboards]
commands =
bash -c "tools/generate_dashboards.sh"
sphinx-build doc/dashboards/ build/