Markdown File Merge
import os import sys def text_merge(folder): files = sorted(os.listdir(folder)) with open( folder + ".md", "w", encoding="utf-8" ) as w: for f in files: path = os.path.join(folder,f) with open( path, "r", encoding='utf-8') as r: w.write(r.read()) w.write('\n\n<div style="page-break-after: always;"></div><br>\n\n') print(path) if __name__ == "__main__": if len(sys.argv) > 1: text_merge(sys.argv[1])