Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hpc-compendium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZIH
hpcsupport
hpc-compendium
Commits
9ab3d02b
Commit
9ab3d02b
authored
2 years ago
by
Michael Bommhardt-Richter
Browse files
Options
Downloads
Patches
Plain Diff
Repair + added archive ignoring (not the best variant but works)
parent
2c9a4b44
No related branches found
Branches containing commit
No related tags found
2 merge requests
!817
Automated merge from preview to main
,
!813
Repair + added archive ignoring
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
+6
-4
6 additions, 4 deletions
doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
with
6 additions
and
4 deletions
doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
+
6
−
4
View file @
9ab3d02b
"""
#!/usr/bin/env python
#!/usr/bin/env python
"""
Check for consistency between TOC and page headings.
Check for consistency between TOC and page headings.
Provide as an command line argument the path to the mkdocs.yml file.
Author: Michael Bommhardt-Richter
Author: Michael Bommhardt-Richter
"""
"""
...
@@ -12,7 +12,7 @@ from pathlib import Path
...
@@ -12,7 +12,7 @@ from pathlib import Path
# {path/filename.md: [toc_heading, file_heading], ... }
# {path/filename.md: [toc_heading, file_heading], ... }
TOCData
=
dict
()
TOCData
=
dict
()
whitelist
=
[
"
index.md
"
]
# ["archive"]
whitelist
=
[
"
index.md
"
,
"
archive/
"
]
# ["archive"]
def
get_heading_in_file
(
filename
,
docs_path
):
def
get_heading_in_file
(
filename
,
docs_path
):
...
@@ -52,11 +52,13 @@ def main():
...
@@ -52,11 +52,13 @@ def main():
for
key
,
value
in
TOCData
.
items
():
for
key
,
value
in
TOCData
.
items
():
if
key
in
whitelist
:
if
key
in
whitelist
:
continue
continue
if
whitelist
[
1
]
in
key
:
continue
if
value
[
0
]
==
"
Overview
"
:
if
value
[
0
]
==
"
Overview
"
:
continue
continue
if
value
[
0
]
!=
value
[
1
]:
if
value
[
0
]
!=
value
[
1
]:
cnt
+=
1
cnt
+=
1
print
(
f
"
{
key
:
<
40
}{
value
[
0
]
:
<
3
0
}
!=
{
value
[
1
]
}
"
)
print
(
f
"
{
key
:
<
40
}{
value
[
0
]
:
<
5
0
}
!=
{
value
[
1
]
}
"
)
sys
.
exit
(
cnt
)
sys
.
exit
(
cnt
)
else
:
else
:
print
(
"
Error: Could not find mkdocs.yml file.
"
)
print
(
"
Error: Could not find mkdocs.yml file.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment