Add a script to generate a Sphinx dashboard documentation
Change-Id: I2bab3eed446b5d5350ca3ea1a5df559fcc2e48aa
This commit is contained in:
parent
0ba8cc5304
commit
ef286643f0
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,3 +22,5 @@ ChangeLog
|
||||
*~
|
||||
.*.swp
|
||||
.bak
|
||||
|
||||
doc/dashboards/
|
||||
|
@ -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:
|
||||
|
@ -1,4 +1 @@
|
||||
============
|
||||
Contributing
|
||||
============
|
||||
.. include:: ../../CONTRIBUTING.rst
|
||||
|
@ -1,5 +1,5 @@
|
||||
`{{ title }}`_
|
||||
==========================
|
||||
==============================================================================
|
||||
|
||||
{% if description %}
|
||||
Description::
|
||||
|
46
tools/generate_dashboards.sh
Executable file
46
tools/generate_dashboards.sh
Executable 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
|
8
tox.ini
8
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/
|
||||
|
Loading…
Reference in New Issue
Block a user