Skip to content
Snippets Groups Projects
Commit fbe33d2f authored by Lubomir Prda's avatar Lubomir Prda
Browse files

Merge branch 'patch-1' into 'master'

capitalize check also for mkdocs.yml

See merge request !102
parents 9632287a 22217da4
No related branches found
No related tags found
5 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!102capitalize check also for mkdocs.yml
Pipeline #
......@@ -24,6 +24,7 @@ capitalize:
image: davidhrbac/docker-mkdocscheck:latest
allow_failure: true
script:
- scripts/titlemd_test.py mkdocs.yml
- find docs.it4i/ -name '*.md' -print0 | xargs -0 -n1 scripts/titlemd_test.py
spell check:
......
......@@ -29,13 +29,15 @@ def main(location):
prev_line = lines.pop(0)
disabled = 0
echo_filename = False
if location.find("mkdocs.yml") != -1:
disabled = 1
for line in lines:
if line.startswith("``") and disabled == 0:
if (line.startswith("``") or line.startswith("extra:")) and disabled == 0:
disabled = 1
else:
if line.startswith("``") and disabled == 1:
if (line.startswith("``") or prev_line.startswith("pages:")) and disabled == 1:
disabled = 0
if line.startswith('#') and disabled == 0:
if line.startswith('#') and disabled == 0 and (location.find("mkdocs.yml") == -1):
if line != titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):]:
if return_value == 0 and echo_filename == False:
print("%s" % location)
......@@ -53,6 +55,15 @@ def main(location):
print("+"+titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):],end="")
print()
return_value = 1
if ((location.find("mkdocs.yml") != -1) and not line.startswith('#') and disabled == 0):
if line != titlecase(line[:(line.find(":"))], callback=abbreviations)+line[(line.find(":")):]:
if return_value == 0 and echo_filename == False:
print("%s" % location)
echo_filename = True
print("-"+line,end="")
print("+"+titlecase(line[:(line.find(":"))], callback=abbreviations)+line[(line.find(":")):],end="")
print()
return_value = 1
prev_line = line
exit(return_value)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment