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

remove the category from img path

parent 8d958c4a
No related branches found
No related tags found
No related merge requests found
import os
def get_category(filename):
name_list = filename.split("-")
return name_list[2]
def prepare_qms(localroot, root, filename, nb):
os.chdir(root)
......@@ -15,9 +20,12 @@ def prepare_qms(localroot, root, filename, nb):
# replace latex command for titles
filedata = filedata.replace("{-}", "##")
# get the category
category = get_category(filename)
# deal with img location
filedata = filedata.replace("policies/"+filename[:-3]+"/", "")
filedata = filedata.replace("sops/"+filename[:-3]+"/", "")
filedata = filedata.replace("policies/" + category + "/" + filename[:-3] + "/", "")
filedata = filedata.replace("sops/" + category + "/" + filename[:-3] + "/", "")
# replace img attributes
filedata = filedata.replace("{ width=50% }", "")
......
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