In the vmarkdown server, list directories before files.

This commit is contained in:
Ethan Dalool 2020-03-27 23:23:49 -07:00
parent bbe78bc5af
commit 093611e527

View file

@ -601,7 +601,8 @@ def markdown_flask(core_filename, port, *args, **kwargs):
if path.is_dir:
atags = []
for child in path.listdir():
children = sorted(path.listdir(), key=lambda p: (p.is_file, p.basename.lower()))
for child in children:
relative = child.relative_to(cwd, simple=True)
print(relative)
a = f'<p><a href="/{relative}">{child.basename}</a></p>'