@@ -113,10 +113,10 @@ def convert_files(args):
113113
114114 out_file_path = os .path .join (file_dir , filename + ".md" )
115115
116- # docx_to_md(args, docx_file, out_file_path, file_dir)
117- # extract_embedded_files(docx_file, file_dir)
118- # add_embedded_file_content(out_file_path, file_dir)
119- # remove_done_file(filename, os.path.dirname(docx_file))
116+ docx_to_md (args , docx_file , out_file_path , file_dir )
117+ extract_embedded_files (docx_file , file_dir )
118+ add_embedded_file_content (out_file_path , file_dir )
119+ remove_done_file (filename , os .path .dirname (docx_file ))
120120 if args .gen_contents :
121121 gen_contents (args )
122122
@@ -223,8 +223,8 @@ def add_embedded_file_content(out_file_path, file_dir):
223223 odt_text = Markdown_Formatter .format_tabs (odt_text )
224224 language = "text"
225225
226- # Get the odt number and check if it is in the matches. If it is, replace
227- # the match with the odt text
226+ # Get the odt number and check if it is in the matches. If it is,
227+ # replace the match with the odt text
228228 odt_file_name = os .path .basename (odt_file ).split ("." )[0 ]
229229 odt_num = odt_file_name .split ("-" )[1 ]
230230
@@ -260,7 +260,7 @@ def remove_done_file(filename, input_dir):
260260def gen_contents (args ):
261261 print ("Generating contents.md..." )
262262 path = chdir ()
263- conents_path = os .path .abspath (os .path .join (args .out_directory , "README.md" ))
263+ contents_path = os .path .abspath (os .path .join (args .out_directory , "README.md" ))
264264 notes_category = {}
265265 for root , _ , files in os .walk (args .out_directory ):
266266 for file in files :
@@ -271,7 +271,7 @@ def gen_contents(args):
271271 else :
272272 notes_category [category ].append (os .path .join (root , file ))
273273
274- with open (conents_path , "w" ) as contents_file :
274+ with open (contents_path , "w" ) as contents_file :
275275 contents_file .write ("# Table of Contents\n \n " )
276276 for category in sorted (notes_category .keys ()):
277277 contents_file .write (f"\n ## { category } \n \n " )
@@ -287,7 +287,8 @@ def gen_contents(args):
287287 readme_path = os .path .abspath (os .path .join (path , ".." , "README.md" ))
288288 with open (readme_path , "r" ) as readme_file :
289289 readme_content = readme_file .read ()
290- # find and delete the text between the ## Table of Contents and the ## Disclaimer
290+ # find and delete the text between the ## Table of Contents and the
291+ # ## Disclaimer
291292 table_of_contents = re .search (
292293 r"## Table of Contents(.*\n)+## Disclaimer" , readme_content
293294 )
0 commit comments