From 2f16fce28b50d3de8e6a2ce80f1aa31d387bfaf0 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Tue, 20 Dec 2016 14:48:13 -0800 Subject: [PATCH 1/5] Add script for verifying docs without entry --- .travis.yml | 1 + skip_toc_check.txt | 3 +++ verify-entry-toc.sh | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 skip_toc_check.txt create mode 100755 verify-entry-toc.sh diff --git a/.travis.yml b/.travis.yml index 61caa32130..ba509e32d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/skip_toc_check.txt b/skip_toc_check.txt new file mode 100644 index 0000000000..eabcf6e724 --- /dev/null +++ b/skip_toc_check.txt @@ -0,0 +1,3 @@ +# Put files you want to skip table of contents entry check here: +docs/search.md +docs/sitemap.md diff --git a/verify-entry-toc.sh b/verify-entry-toc.sh new file mode 100755 index 0000000000..95ab757cda --- /dev/null +++ b/verify-entry-toc.sh @@ -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 From 89765673af7b102f07a2c605c89ec8eddc9a23fa Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Tue, 27 Dec 2016 16:36:39 -0800 Subject: [PATCH 2/5] Update verify TOC rules for index.md --- skip_toc_check.txt | 2 ++ verify-entry-toc.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/skip_toc_check.txt b/skip_toc_check.txt index eabcf6e724..e1a507b69a 100644 --- a/skip_toc_check.txt +++ b/skip_toc_check.txt @@ -1,3 +1,5 @@ # 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 diff --git a/verify-entry-toc.sh b/verify-entry-toc.sh index 95ab757cda..7c0f13c518 100755 --- a/verify-entry-toc.sh +++ b/verify-entry-toc.sh @@ -7,6 +7,8 @@ no_entry=false 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 From 9936a9b6ad2a64e514d45e99cbd0802920c109d1 Mon Sep 17 00:00:00 2001 From: devin-donnelly Date: Thu, 5 Jan 2017 14:00:41 -0800 Subject: [PATCH 3/5] Update skip_toc_check.txt --- skip_toc_check.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skip_toc_check.txt b/skip_toc_check.txt index e1a507b69a..a49e6500d2 100644 --- a/skip_toc_check.txt +++ b/skip_toc_check.txt @@ -3,3 +3,5 @@ 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 From 0fd4965cd40ba76a013be2de54f251dd5ef56c07 Mon Sep 17 00:00:00 2001 From: devin-donnelly Date: Thu, 5 Jan 2017 14:12:45 -0800 Subject: [PATCH 4/5] Update skip_toc_check.txt --- skip_toc_check.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/skip_toc_check.txt b/skip_toc_check.txt index a49e6500d2..984cffd9e2 100644 --- a/skip_toc_check.txt +++ b/skip_toc_check.txt @@ -5,3 +5,4 @@ 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 From 701f01defa59f42d4825c06d01429d4a35ffaed8 Mon Sep 17 00:00:00 2001 From: devin-donnelly Date: Thu, 5 Jan 2017 14:20:53 -0800 Subject: [PATCH 5/5] Update skip_toc_check.txt --- skip_toc_check.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skip_toc_check.txt b/skip_toc_check.txt index 984cffd9e2..00d5a5bdec 100644 --- a/skip_toc_check.txt +++ b/skip_toc_check.txt @@ -6,3 +6,5 @@ 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