@@ -462,6 +462,9 @@ def main():
462462 parser = argparse .ArgumentParser (prog = 'index2ddg.py' )
463463 parser .add_argument ('index' , type = str ,
464464 help = 'The path to the XML index containing identifier data' )
465+ parser .add_argument ('reference' , type = str ,
466+ help = ('The path to the downloaded reference (reference '
467+ 'directory in the downloaded archive)' ))
465468 parser .add_argument ('output' , type = str ,
466469 help = 'The path to destination output.txt file' )
467470 parser .add_argument ('--split_code_snippets' , action = 'store_true' , default = False ,
@@ -503,11 +506,11 @@ def main():
503506 tr .transform (index_file )
504507
505508 # get a list of existing pages
506- html_files = get_html_files (' reference' )
509+ html_files = get_html_files (args . reference )
507510
508511 # get a mapping between titles and pages
509512 # linkmap = dict { title -> filename }
510- link_map = build_link_map (' reference' )
513+ link_map = build_link_map (args . reference )
511514
512515 # create a list of processing instructions for each page
513516 proc_ins = get_processing_instructions (ident_map , link_map )
@@ -538,7 +541,7 @@ def main():
538541 #print(str(i) + '/' + str(len(proc_ins)) + ': ' + link)
539542 #i+=1
540543
541- root = e .parse (' reference/' + fn , parser = html .HTMLParser ())
544+ root = e .parse (os . path . join ( args . reference , fn ) , parser = html .HTMLParser ())
542545
543546 for ident in idents :
544547
0 commit comments