Add script for verifying docs without entry
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Put files you want to skip table of contents entry check here:
|
||||
docs/search.md
|
||||
docs/sitemap.md
|
||||
Executable
+20
@@ -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
|
||||
Reference in New Issue
Block a user