Simplify publishdocs et al
We don't have different content for build and publish, so can cleanup our scripts and remove any special handling. Remove also usage of www-index.html. Change-Id: If1a9d9a2dddbf7cdf9fd4c01d22530f2cd181907
This commit is contained in:
parent
adc92586c9
commit
1d08a657f6
@ -12,38 +12,15 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
PUBLISH=$1
|
|
||||||
|
|
||||||
if [[ -z "$PUBLISH" ]] ; then
|
|
||||||
echo "usage $0 (publish|build)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p publish-docs/html
|
mkdir -p publish-docs/html
|
||||||
|
|
||||||
# Build all RST guides including PDF files
|
# Build all RST guides including PDF files
|
||||||
tools/build-all-rst.sh --pdf
|
tools/build-all-rst.sh --pdf
|
||||||
|
|
||||||
# Build the www pages so that openstack-indexpage creates a link to
|
# Build website
|
||||||
# www/www-index.html.
|
python3 tools/www-generator.py --source-directory www/ \
|
||||||
if [ "$PUBLISH" = "build" ] ; then
|
--output-directory publish-docs/html --publish
|
||||||
python3 tools/www-generator.py --source-directory www/ \
|
rsync -a www/static/ publish-docs/html/
|
||||||
--output-directory publish-docs/html/www/
|
|
||||||
rsync -a www/static/ publish-docs/html/www/
|
|
||||||
# publish-docs/html/www-index.html is the trigger for openstack-indexpage
|
|
||||||
# to include the file.
|
|
||||||
mv publish-docs/html/www/www-index.html publish-docs/html/www-index.html
|
|
||||||
fi
|
|
||||||
if [ "$PUBLISH" = "publish" ] ; then
|
|
||||||
python3 tools/www-generator.py --source-directory www/ \
|
|
||||||
--output-directory publish-docs/html --publish
|
|
||||||
rsync -a www/static/ publish-docs/html/
|
|
||||||
# Don't publish these files
|
|
||||||
rm publish-docs/html/www-index.html
|
|
||||||
rm -rf publish-docs/html/project-data
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$PUBLISH" = "build" ] ; then
|
# Don't publish these files
|
||||||
# Create index page for viewing
|
rm -rf publish-docs/html/project-data
|
||||||
openstack-indexpage publish-docs/html
|
|
||||||
fi
|
|
||||||
|
@ -12,8 +12,5 @@ fi
|
|||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
rsync -a www/static/ $output
|
rsync -a www/static/ $output
|
||||||
fi
|
fi
|
||||||
# publish-docs/html/www-index.html is the trigger for openstack-indexpage
|
|
||||||
# to include the file.
|
|
||||||
#mv publish-docs/html/www/www-index.html publish-docs/html/www-index.html
|
|
||||||
|
|
||||||
.tox/publishdocs/bin/whereto $output/.htaccess $output/redirect-tests.txt
|
.tox/publishdocs/bin/whereto $output/.htaccess $output/redirect-tests.txt
|
||||||
|
@ -602,18 +602,12 @@ def main():
|
|||||||
|
|
||||||
# Render the templates.
|
# Render the templates.
|
||||||
output_pages = []
|
output_pages = []
|
||||||
page_list_template = None
|
|
||||||
template_files = environment.list_templates()
|
template_files = environment.list_templates()
|
||||||
for template_file in template_files:
|
for template_file in template_files:
|
||||||
if (template_file.startswith('static/') or
|
if (template_file.startswith('static/') or
|
||||||
template_file.startswith('templates/')):
|
template_file.startswith('templates/')):
|
||||||
logger.info('ignoring %s', template_file)
|
logger.info('ignoring %s', template_file)
|
||||||
continue
|
continue
|
||||||
if template_file.endswith('www-index.html'):
|
|
||||||
# Process this one at the end, so we have the full list of
|
|
||||||
# other output files.
|
|
||||||
page_list_template = template_file
|
|
||||||
continue
|
|
||||||
render_template(
|
render_template(
|
||||||
environment,
|
environment,
|
||||||
project_data,
|
project_data,
|
||||||
@ -626,22 +620,6 @@ def main():
|
|||||||
)
|
)
|
||||||
output_pages.append(template_file)
|
output_pages.append(template_file)
|
||||||
|
|
||||||
if page_list_template is not None:
|
|
||||||
output_pages.sort()
|
|
||||||
render_template(
|
|
||||||
environment,
|
|
||||||
project_data,
|
|
||||||
regular_repos,
|
|
||||||
infra_repos,
|
|
||||||
template_files,
|
|
||||||
page_list_template,
|
|
||||||
args.output_directory,
|
|
||||||
args.publish,
|
|
||||||
extra={
|
|
||||||
'file_list': output_pages,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
2
tox.ini
2
tox.ini
@ -49,7 +49,7 @@ commands =
|
|||||||
# published on docs.openstack.org with just copying publish-docs/*
|
# published on docs.openstack.org with just copying publish-docs/*
|
||||||
# over.
|
# over.
|
||||||
commands =
|
commands =
|
||||||
{toxinidir}/tools/publishdocs.sh publish
|
{toxinidir}/tools/publishdocs.sh
|
||||||
whereto publish-docs/html/.htaccess publish-docs/html/redirect-tests.txt
|
whereto publish-docs/html/.htaccess publish-docs/html/redirect-tests.txt
|
||||||
rm publish-docs/html/redirect-tests.txt
|
rm publish-docs/html/redirect-tests.txt
|
||||||
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
||||||
<body>
|
|
||||||
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
|
|
||||||
<ul>
|
|
||||||
{% for outfile in file_list %}
|
|
||||||
<li><a href="www/{{outfile}}">{{outfile}}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user