Update doc-tools-build-rst
Import change I6c275518b9e55ab3b6bcea52894ea851924bee94 from openstack-manuals: Add linkcheck for RST. Change-Id: I1774ddf76d3930318dd0f59e9f938065eb9f07a4
This commit is contained in:
parent
83ece75a64
commit
de062557cc
@ -21,6 +21,7 @@ if [ -z "$DIRECTORY" ] ; then
|
|||||||
echo "--tag TAG: Use given tag for building"
|
echo "--tag TAG: Use given tag for building"
|
||||||
echo "--target TARGET: Copy files to publish-docs/$TARGET"
|
echo "--target TARGET: Copy files to publish-docs/$TARGET"
|
||||||
echo "--build BUILD: Name of build directory"
|
echo "--build BUILD: Name of build directory"
|
||||||
|
echo "--linkcheck: Check validity of links instead of building"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -29,10 +30,18 @@ TARGET=""
|
|||||||
TAG=""
|
TAG=""
|
||||||
TAG_OPT=""
|
TAG_OPT=""
|
||||||
BUILD=""
|
BUILD=""
|
||||||
|
LINKCHECK=""
|
||||||
|
|
||||||
while [[ $# > 1 ]] ; do
|
while [[ $# > 0 ]] ; do
|
||||||
option="$1"
|
option="$1"
|
||||||
case $option in
|
case $option in
|
||||||
|
--build)
|
||||||
|
BUILD="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--linkcheck)
|
||||||
|
LINKCHECK=1
|
||||||
|
;;
|
||||||
--glossary)
|
--glossary)
|
||||||
GLOSSARY=1
|
GLOSSARY=1
|
||||||
;;
|
;;
|
||||||
@ -45,10 +54,6 @@ while [[ $# > 1 ]] ; do
|
|||||||
TARGET="$2"
|
TARGET="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--build)
|
|
||||||
BUILD="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -70,17 +75,25 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TAG" ] ; then
|
if [ -z "$TAG" ] ; then
|
||||||
echo "Building $DIRECTORY"
|
echo "Checking $DIRECTORY..."
|
||||||
else
|
else
|
||||||
echo "Building $DIRECTORY with tag $TAG"
|
echo "Checking $DIRECTORY with tag $TAG..."
|
||||||
fi
|
fi
|
||||||
# Show sphinx-build invocation for easy reproduction
|
|
||||||
set -x
|
|
||||||
sphinx-build -E -W -b html $TAG_OPT $DIRECTORY/source $BUILD_DIR
|
|
||||||
set +x
|
|
||||||
|
|
||||||
# Copy RST
|
if [ "$LINKCHECK" = "1" ] ; then
|
||||||
if [ "$TARGET" != "" ] ; then
|
# Show sphinx-build invocation for easy reproduction
|
||||||
mkdir -p publish-docs/$TARGET
|
set -x
|
||||||
rsync -a $BUILD_DIR/ publish-docs/$TARGET/
|
sphinx-build -E -W -b linkcheck $TAG_OPT $DIRECTORY/source $BUILD_DIR
|
||||||
|
set +x
|
||||||
|
else
|
||||||
|
# Show sphinx-build invocation for easy reproduction
|
||||||
|
set -x
|
||||||
|
sphinx-build -E -W -b html $TAG_OPT $DIRECTORY/source $BUILD_DIR
|
||||||
|
set +x
|
||||||
|
|
||||||
|
# Copy RST
|
||||||
|
if [ "$TARGET" != "" ] ; then
|
||||||
|
mkdir -p publish-docs/$TARGET
|
||||||
|
rsync -a $BUILD_DIR/ publish-docs/$TARGET/
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user