Add script for verifying docs without entry

This commit is contained in:
Janet Kuo
2016-12-20 14:48:13 -08:00
parent da5c6e41c2
commit 2f16fce28b
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -14,3 +14,4 @@ install:
script:
- go test -v k8s.io/kubernetes.github.io/test
- $GOPATH/bin/md-check --root-dir=$HOME/gopath/src/k8s.io/kubernetes.github.io
- ./verify-entry-toc.sh
+3
View File
@@ -0,0 +1,3 @@
# Put files you want to skip table of contents entry check here:
docs/search.md
docs/sitemap.md
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
no_entry=false
# Verify all docs/.../*.md files are referenced in at least one of _data/*.yml
# files. Skip checking files in skip_toc_check.txt
for file in `find docs -name "*.md" -type f`; do
if ! grep -q "${file}" skip_toc_check.txt; then
path=${file%.*}
if ! grep -q "${path}" _data/*.yml; then
echo "Error: ${file} doesn't have an entry in the table of contents under _data/*.yml"
no_entry=true
fi
fi
done
if ${no_entry}; then
echo "Found files without entries. For how to fix it, see http://kubernetes.io/docs/contribute/write-new-topic/#creating-an-entry-in-the-table-of-contents"
exit 1
fi