From 74060611c44a036e160c718297979102f08e5432 Mon Sep 17 00:00:00 2001
From: laurentheirendt <laurent.heirendt@uni.lu>
Date: Tue, 20 Sep 2022 09:19:05 +0200
Subject: [PATCH] remove part from core

---
 .ci/generateIndex.py | 90 +-------------------------------------------
 1 file changed, 1 insertion(+), 89 deletions(-)

diff --git a/.ci/generateIndex.py b/.ci/generateIndex.py
index 9f72ae9f..c2611342 100644
--- a/.ci/generateIndex.py
+++ b/.ci/generateIndex.py
@@ -44,9 +44,6 @@ for folder in cardDirs:
 
         for d in dirs:
             if d[0] != "." and d not in ignore and has_subdirs(folder + "/" + d):
-                # set the header of the section
-                #index += "\n### " + d.replace("-", " ").capitalize() + "\n"
-
                 # get the index of the section
                 indexS = sections.index(d)
                 maxOrder = 0
@@ -59,93 +56,8 @@ for folder in cardDirs:
                     for file in files:
                         if file.endswith(".md"):
                             fileName = os.path.join(root, file)
+                            folderFlag, localIndexArr, whiteList = core(file, fileName, localroot, root, folder, localIndexArr, orderArr, indexS, whiteList, folderFlag, maxOrder)
 
-                            # ignore subsections (.md files that start with _)
-                            if file[0] != "_":
-                                print(" > Generating header for: " + fileName)
-
-                                # save order and legacy section
-                                order = save_tag(localroot, root, file, "card_order")
-                                legacy_from = save_legacy_from(localroot, root, file)
-                                description = save_tag(localroot, root, file, "description")
-
-                                # extract the title from the QMS metadata
-                                title, qms_yml, yml_file = get_title(localroot, root, file)
-
-                                if qms_yml:
-                                    name = save_tag(localroot, root, yml_file, "name")
-                                    prepare_qms(localroot, root, file)
-
-                                # remove the previous header
-                                n = remove_header(localroot, root, file)
-
-                                # generate a permalink
-                                permalink = "/" + root + "/"
-
-                                # generate the shortcut
-                                shortcut = re.sub(folder, '', root)
-
-                                # remove the first /
-                                shortcut = shortcut[1:]
-
-                                # replace the / with a :
-                                shortcut = re.sub('/', ':', shortcut)
-
-                                if len(order) > 0:
-                                     # find the maximum of existing orders
-                                    if folderFlag:
-                                        if len(orderArr[indexS]) > 0:
-                                            maxOrder = max(orderArr[indexS])
-                                        else:
-                                            maxOrder = 0
-                                        # after determining the max order, set the folder flag to False to avoid another entry into the same block of code
-                                        folderFlag = False
-
-                                    tmp = orderArr[indexS].copy()
-                                    tmp.append(maxOrder + int(order))
-                                    orderArr[indexS] = tmp
-                                else:
-                                    orderArr[indexS] = []
-
-                                # generate the header for each card
-                                header = generate_header(folder, permalink, shortcut, order, legacy_from, title, description, qms_yml)
-
-                                # add autogenerated links to whitelist
-                                whiteList += generate_whitelist_entry(folder, permalink, shortcut)
-
-                                # add the header properly speaking
-                                line_prepender(fileName, header)
-
-                                # open file and get the title after the header
-                                if "qms" in root:
-                                    header_offset = 3
-                                else:
-                                    header_offset = 1
-
-                                if not qms_yml:
-                                    count = 0
-                                    title = ""
-                                    bp = n + header_offset
-
-                                    with open(fileName, 'r') as f:
-                                        for line in f:
-                                            count += 1
-                                            if count == bp:
-                                                if len(line) > 2:
-                                                    title = line
-                                                    break
-                                                else:
-                                                    bp += 1
-
-                                    # remove first and last chars
-                                    title = title.rstrip("\n\r")
-                                    title = title[2:]
-
-                                localIndexArr[indexS].append(build_link(title, root))
-
-                                # output
-                                print(" + New header added.")
-                                print("-----------------------")
 
 
 # ordering of cards
-- 
GitLab