Skip to content Skip to footer

import os import re

pagesdir = ‘pages’ white_list= [‘Google’, ‘Research Data Management Kit’, ‘Data Management Plan’, ‘Data Management Planning’, ‘DMP’, ‘RDMkit’, ‘I ‘, ‘NeLS’, ‘ELIXIR’, ‘GitHub’]

for subdir, dirs, files in os.walk(pagesdir): for file_name in files: if os.path.splitext(file_name)[1] == ‘.md’: with open(subdir + ‘/’ + file_name) as f: read_data = f.readlines() for i,line in enumerate(read_data): title =’^title: (.)\n’, line) heading =’^#+ (.)\n’, line) if title or heading: if title: pro_line = line.replace(, else: pro_line = line.replace(,

                    for key in white_list:
                        if key.lower() in pro_line:
                            pro_line = pro_line.replace(key.lower(), key)
                    read_data[i] = pro_line
        with open(subdir + '/' + file_name, 'w') as ff: