Skip to content
Snippets Groups Projects
Verified Commit ec284535 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

automatic detection of breakpoint for title

parent ef848080
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,8 @@ def remove_header(localroot, root, filename):
# change back to the local root
os.chdir(localroot)
return n
# loop through the entire internal tree
localroot = os.getcwd()
......@@ -161,10 +163,7 @@ for folder in cardDirs:
legacy_from = save_legacy_from(localroot, root, file)
# remove the previous header
if "handbook-annexes" in fileName or "handbook-additional" in fileName:
remove_header(localroot, root, file)
else:
remove_header(localroot, root, file)
n = remove_header(localroot, root, file)
# generate a permalink
permalink = "/" + root + "/"
......@@ -214,10 +213,7 @@ for folder in cardDirs:
# open file and get the title after the header
count = 0
title = ""
if "handbook-annexes" in permalink or "handbook-additional" in permalink:
bp = 11
else:
bp = 9
bp = n + 1
with open(fileName, 'r') as f:
for line in f:
......
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