openstack-manuals/tools/generatepot-rst.sh
Andreas Jaeger 47c2f792ac Remove RST tags user_only and admin_only
These tags are now completely unused, remove them from scripts setting
them.

Now we can simplify publishdocs.sh with a simple loop instead of
separate invocations.

Remove our scope sphinx extensions, it's not needed anymore.
Remove also the hot extension from the Admin User Guide, it's only used
in the End User Guide.

Change-Id: Ib6c9f35e336ee13b84030a6e7164dea27d621e67
2015-05-13 18:09:39 +00:00

41 lines
1.5 KiB
Bash
Executable File

#!/bin/bash -xe
#
# 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.
#
# Copy files from trunk to named branch and replace all links from
# trunk with links to the branch
DOCNAME=$1
if [ -z "$DOCNAME" ] ; then
echo "usage $0 DOCNAME"
exit 1
fi
# Build Glossary
tools/glossary2rst.py doc/common-rst/glossary.rst
# First remove the old pot file, otherwise the new file will contain
# old references
rm -f doc/$DOCNAME/source/locale/$DOCNAME.pot
sphinx-build -b gettext doc/$DOCNAME/source/ doc/$DOCNAME/source/locale/
# Take care of deleting all temporary files so that git add
# doc/$DOCNAME/source/locale will only add the single pot file.
# Remove UUIDs, those are not necessary and change too often
msgcat --sort-output doc/$DOCNAME/source/locale/*.pot | \
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/$DOCNAME/source/$DOCNAME.pot
rm doc/$DOCNAME/source/locale/*.pot
rm -rf doc/$DOCNAME/source/locale/.doctrees/
mv doc/$DOCNAME/source/$DOCNAME.pot doc/$DOCNAME/source/locale/$DOCNAME.pot