| 68 | for line in src)) |
| 69 | |
| 70 | def convert(zh_folder, tw_folder): |
| 71 | home = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), '..')) |
| 72 | zh_dirpath = os.path.join(home, 'content', zh_folder) |
| 73 | tw_dirpath = os.path.join(home, 'content', tw_folder) |
| 74 | for file in os.listdir(zh_dirpath): |
| 75 | if file.endswith('.md'): |
| 76 | zh_filepath = os.path.join(zh_dirpath, file) |
| 77 | tw_filepath = os.path.join(tw_dirpath, file) |
| 78 | convert_file(zh_filepath, tw_filepath, zh_folder, tw_folder) |
| 79 | |
| 80 | if __name__ == '__main__': |
| 81 | print(sys.argv) |