Commit 7148c270 authored by Michael Murtaugh's avatar Michael Murtaugh

argparse for makefile, urlparse for path separation

parent acb536fa
......@@ -45,6 +45,7 @@ def directory_as_html(filepath, directory, prefix):
# rel_path = os.path.relpath(_file, directory)
# file_url = prefix + '/' + rel_path
file_url = '/' + urlquote(os.path.join(filepath, _file))
editor_url = f"/dist/index.html#{file_url}"
# if file is a directory, add '/' to the end of the name
if os.path.isdir(_file):
file_name = "{}/".format(_file)
......@@ -52,8 +53,10 @@ def directory_as_html(filepath, directory, prefix):
file_name = _file
index_list.append(
'<li><a href="{url}">{name}</a></li>'.format(url=file_url,
name=file_name)
'<li><a href="{url}" target="{target}">{name}</a></li>'.format(
url=editor_url,
target="editor",
name=file_name)
)
ul = "<ul>\n{}\n</ul>".format('\n'.join(index_list))
body = "<body>\n{}\n{}\n</body>".format(h1, ul)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment