forked from approvals/ApprovalTests.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_markdown.sh
More file actions
executable file
·28 lines (23 loc) · 1.05 KB
/
Copy pathfix_markdown.sh
File metadata and controls
executable file
·28 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
find . -name \*.md | grep -v googletest-src | xargs sed -i '' -f fix_markdown.sed
echo
echo "The following files, if any, are missing their 'top' anchor:"
find . -name \*.md | grep -v googletest-src | grep -v README.md | grep -v README.source.md | xargs grep -L '<a id="top"></a>' | grep -v 'relnotes_'
echo
echo "The following files in doc, if any, are missing the 'Back to User Guide' line at the end:"
find ./doc -name \*.md | grep -v googletest-src | grep -v README.md | grep -v README.source.md | xargs grep -L 'Back to User Guide'
echo
echo "The following files, if any, need to have relative references converted to absolute ones"
find . -name \*.source.md | grep -v googletest-src | xargs grep -P '\]\((?!#|http|/|mailto)' | grep -v '[this link is wrong]'
echo
echo "The following files, if any, are not in the User Guide (doc/README.md)"
pushd doc > /dev/null
for file in *.md
do
if [ $file = "README.md" ] || [ $file = "TemplatePage.md" ]
then
continue
fi
grep -q $file README.md || echo $file
done
popd > /dev/null