Files
zulip/tools/test-documentation
David Rosa Tamsen 7072fa5b37 docs: Reorganize developer docs to improve navigation.
This commit helps reduce clutter on the navigation sidebar.
Creates new directories and moves relevant files into them.
Modifies index.rst, symlinks, and image paths accordingly.

This commit also enables expandable/collapsible navigation items,
renames files in docs/development and docs/production,
modifies /tools/test-documentation so that it overrides a theme setting,
Also updates links to other docs, file paths in the codebase that point
to developer documents, and files that should be excluded from lint tests.

Note that this commit does not update direct links to
zulip.readthedocs.io in the codebase; those will be resolved in an
upcoming follow-up commit (it'll be easier to verify all the links
once this is merged and ReadTheDocs is updated).

Fixes #5265.
2017-11-16 09:45:08 -08:00

43 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
case $1 in
-h|--help)
echo "--help, -h show this help message and exit"
echo "--loglevel=LEVEL, -L LEVEL log level (default: ERROR)"
exit 0
;;
-L|--loglevel)
loglevel="$1 $2"
;;
esac
cd "$(dirname "$0")"/../docs
rm -rf _build
# collapse_navigation is set to False in conf.py to improve sidebar navigation for users.
# However, we must change its value to True before we begin testing links.
# Otherwise, sphinx would generate a large number of links we don't need to test.
# The crawler would take a very long time to finish and TravisCI would fail as a result.
sphinx-build -b html -d _build/doctrees -D html_theme_options.collapse_navigation=True . _build/html
cd ../tools/documentation_crawler
echo -en "\033[0;94m"
echo "Testing links in documentation..."
echo -en "\033[0m"
set +e
scrapy crawl_with_status documentation_crawler $loglevel
result=$?
if [ "$result" = 1 ]; then
echo -en "\033[0;91m"
echo "Failed!"
echo -en "\033[0m"
exit 1
else
echo -en "\033[0;92m"
echo "Passed!"
echo -en "\033[0m"
exit 0
fi