From 4af5085f1754c217d67aa2ae42ecf4b54d31545f Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 19 May 2017 10:36:20 +0200 Subject: [PATCH] Sort namespaces and types when generating the docs (#87) --- docs/generate.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/generate.py b/docs/generate.py index 8ad67a75..df91379d 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -154,6 +154,7 @@ def generate_index(folder, original_paths): if namespaces: docs.write_title('Namespaces', level=3) docs.begin_table(4) + namespaces.sort() for namespace in namespaces: # For every namespace, also write the index of it generate_index(os.path.join(folder, namespace), original_paths) @@ -164,9 +165,13 @@ def generate_index(folder, original_paths): docs.write_title('Available items') docs.begin_table(2) - for file in files: - docs.add_row(find_title(os.path.join(folder, file)), - link=file) + + files = [(f, find_title(os.path.join(folder, f))) for f in files] + files.sort(key=lambda t: t[1]) + + for file, title in files: + docs.add_row(title, link=file) + docs.end_table() docs.end_body()