Merge pull request #2007 from janetkuo/verify-toc
Add script for verifying docs without entry
This commit is contained in:
@@ -14,3 +14,4 @@ install:
|
|||||||
script:
|
script:
|
||||||
- go test -v k8s.io/kubernetes.github.io/test
|
- go test -v k8s.io/kubernetes.github.io/test
|
||||||
- $GOPATH/bin/md-check --root-dir=$HOME/gopath/src/k8s.io/kubernetes.github.io
|
- $GOPATH/bin/md-check --root-dir=$HOME/gopath/src/k8s.io/kubernetes.github.io
|
||||||
|
- ./verify-entry-toc.sh
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Put files you want to skip table of contents entry check here:
|
||||||
|
docs/search.md
|
||||||
|
docs/sitemap.md
|
||||||
|
docs/user-guide/pods/_viewing-a-pod.md
|
||||||
|
docs/user-guide/simple-yaml.md
|
||||||
|
docs/user-guide/walkthrough/index.md
|
||||||
|
docs/user-guide/walkthrough/k8s201.md
|
||||||
|
docs/user-guide/logging-demo/README.md
|
||||||
|
docs/user-guide/downward-api/README.md
|
||||||
|
docs/user-guide/configmap/README.md
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/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%.*}
|
||||||
|
# abc/index.md should point to abc, not abc/index
|
||||||
|
path=${path%%index}
|
||||||
|
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