File tree Expand file tree Collapse file tree 3 files changed +36
-7
lines changed Expand file tree Collapse file tree 3 files changed +36
-7
lines changed Original file line number Diff line number Diff line change 4242
4343TBD
4444
45- Go to [ Table of Contents ] ( /README.md#contents ) \
46- Go to [ Overview] ( /README.md )
45+ Go to [ Index ] ( ../?tab=readme-ov-file#index ) \
46+ Go to [ Overview] ( ../?tab=readme-ov-file )
Original file line number Diff line number Diff line change 4343
4444TBD
4545
46- Go to [ Table of Contents ] ( /README.md#contents ) \
47- Go to [ Overview] ( /README.md )
46+ Go to [ Index ] ( ../?tab=readme-ov-file#index ) \
47+ Go to [ Overview] ( ../?tab=readme-ov-file )
Original file line number Diff line number Diff line change @@ -44,15 +44,44 @@ def process_nb(filename, nb):
4444 file .writelines (lines )
4545
4646
47+
48+
49+ def process_url (filename ):
50+ with open (filename , 'r' ) as file :
51+ lines = file .readlines ()
52+
53+ url_old_1 = "Go to [Table of Contents](/README.md#contents)"
54+ url_old_2 = "Go to [Overview](/README.md)"
55+
56+ for i in range (len (lines )):
57+
58+ if lines [i ].strip ().startswith (url_old_1 ):
59+ lines [i ] = "Go to [Index](../?tab=readme-ov-file#index)\\ \n "
60+
61+ if lines [i ].strip ().startswith (url_old_2 ):
62+ lines [i ] = "Go to [Overview](../?tab=readme-ov-file)\n "
63+
64+
65+ with open (filename , 'w' ) as file :
66+ file .writelines (lines )
67+
68+
69+
70+
71+
72+
73+
4774# Get all files in solutions directory
4875files = sorted (os .listdir ('solutions/' ))
4976
5077# Process files 1 through 5 # len(files) + 1
51- for i in range (1 , 128 ):
78+ for i in range (1 , 3 ):
5279 filename = f'solutions/{ files [i - 1 ]} '
5380
54- nb = "## NB\n \n TBD"
55- process_nb (filename , nb )
81+ process_url (filename )
82+
83+ # nb = "## NB\n\nTBD"
84+ # process_nb(filename, nb)
5685
5786 # process_submitted_solutions(filename)
5887
You can’t perform that action at this time.
0 commit comments