From 093611e527862c8c9946dafb02f782a6a078bd77 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 27 Mar 2020 23:23:49 -0700 Subject: [PATCH] In the vmarkdown server, list directories before files. --- voussoir.net/writing/vmarkdown.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/voussoir.net/writing/vmarkdown.py b/voussoir.net/writing/vmarkdown.py index 99d1615..23b78cb 100644 --- a/voussoir.net/writing/vmarkdown.py +++ b/voussoir.net/writing/vmarkdown.py @@ -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'

{child.basename}

'