diff --git a/.gitignore b/.gitignore index 7ae095e..c1ff6bf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ ChangeLog *~ .*.swp .bak + +doc/dashboards/ diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 8cc7979..95cc41e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,3 +1,7 @@ +============ +Contributing +============ + 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" section of this page: diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 1728a61..ac7b6bc 100644 --- a/doc/source/contributing.rst +++ b/doc/source/contributing.rst @@ -1,4 +1 @@ -============ -Contributing -============ .. include:: ../../CONTRIBUTING.rst diff --git a/templates/single.rst b/templates/single.rst index 939db21..97f252e 100644 --- a/templates/single.rst +++ b/templates/single.rst @@ -1,5 +1,5 @@ `{{ title }}`_ -========================== +============================================================================== {% if description %} Description:: diff --git a/tools/generate_dashboards.sh b/tools/generate_dashboards.sh new file mode 100755 index 0000000..2d66f4b --- /dev/null +++ b/tools/generate_dashboards.sh @@ -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 diff --git a/tox.ini b/tox.ini index 94bc5a7..275e9ff 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py33,py34,py26,py27,pypy,pep8,checksyntax +envlist = py33,py34,py26,py27,pypy,pep8,checksyntax,dashboards skipsdist = True [testenv] @@ -10,6 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +whitelist_externals = bash [testenv:pep8] commands = flake8 @@ -36,3 +37,8 @@ show-source = True ignore = E123,E125,H803 builtins = _ 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/