Verified Commit 5256a324 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

draft to generate headers in whitelist

parent 948a1404
Pipeline #45760 passed with stages
in 3 minutes and 28 seconds
......@@ -100,6 +100,7 @@ sections = natsorted(sections)
# Index contains the generated content, init it with an empty container
index = ''
index += '\n<div class="index-box-container">\n'
whiteList = ''
localIndexArr = [[]] * len(sections)
for folder in cardDirs:
......@@ -157,6 +158,12 @@ for folder in cardDirs:
header += " - /" + folder + "/cards/" + shortcut + "\n"
header += "---"
# add autogenerated links to whitelist
whiteList += permalink + "\n"
whiteList += "/?" + shortcut + "\n"
whiteList += "/cards/" +shortcut + "\n"
whiteList += "/" + folder + "/cards/" + shortcut + "\n"
# add the header properly speaking
line_prepender(fileName, header)
......@@ -197,7 +204,7 @@ for s in sections:
index += build_section_end()
k += 1
# Close the container
# close the container
index += "\n</div>"
## add link to return to main index
......@@ -226,3 +233,12 @@ with open(indexFile, 'w') as file:
file.write(filedata)
print("\n > New index generated and saved in " + indexFile)
# write link whitelist out
whiteListFile = ".ci/whitelist.txt"
with open(whiteListFile, 'r') as file :
for line in file:
whiteList += line
with open(whiteListFile, 'w') as file:
file.write(whiteList)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment