1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 01:20:40 +00:00

adding doc links tests (ext and int)

This commit is contained in:
deadc0de6
2023-01-19 23:02:31 +01:00
parent 08bd0b9969
commit 71507a2604
3 changed files with 111 additions and 36 deletions

47
test-doc.sh vendored
View File

@@ -2,46 +2,25 @@
# author: deadc0de6 (https://github.com/deadc0de6)
# Copyright (c) 2022, deadc0de6
## test the doc with linkcheckMarkdown
## pip install --user linkcheckmd
## test doc external links
find . -type f -iname '*.md' | while read -r line; do
./scripts/check_links.py "${line}"
done
## test the doc internal links
## https://github.com/remarkjs/remark-validate-links
## https://github.com/tcort/markdown-link-check
set +e
which linkcheckMarkdown >/dev/null 2>&1
which remark >/dev/null 2>&1
r="$?"
set -e
if [ "$r" != "0" ]; then
echo "[ERROR] install \"linkcheckMarkdown\" to test for dead links"
echo "[WARNING] install \"remark\" to test the doc"
exit 1
fi
find . -type f -iname '*.md' | while read line; do
echo "checking links in \"${line}\""
linkcheckMarkdown ${line}
find . -type f -iname '*.md' | while read -r line; do
remark -f -u validate-links "${line}"
done
### test the doc with remark
### https://github.com/remarkjs/remark-validate-links
#set +e
#which remark >/dev/null 2>&1
#r="$?"
#set -e
#if [ "$r" != "0" ]; then
# echo "[WARNING] install \"remark\" to test the doc"
#else
# remark -f -u validate-links docs/
# remark -f -u validate-links *.md
#fi
### test the doc with markdown-link-check
### https://github.com/tcort/markdown-link-check
#set +e
#which markdown-link-check >/dev/null 2>&1
#r="$?"
#set -e
#if [ "$r" != "0" ]; then
# echo "[WARNING] install \"markdown-link-check\" to test the doc"
#else
# for i in `find docs -iname '*.md'`; do markdown-link-check $i; done
# markdown-link-check README.md
#fi
echo "documentation OK"