Sort namespaces and types when generating the docs (#87)

This commit is contained in:
Lonami Exo 2017-05-19 10:36:20 +02:00
parent 57d99eabbb
commit 4af5085f17

View File

@ -154,6 +154,7 @@ def generate_index(folder, original_paths):
if namespaces: if namespaces:
docs.write_title('Namespaces', level=3) docs.write_title('Namespaces', level=3)
docs.begin_table(4) docs.begin_table(4)
namespaces.sort()
for namespace in namespaces: for namespace in namespaces:
# For every namespace, also write the index of it # For every namespace, also write the index of it
generate_index(os.path.join(folder, namespace), original_paths) 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.write_title('Available items')
docs.begin_table(2) docs.begin_table(2)
for file in files:
docs.add_row(find_title(os.path.join(folder, file)), files = [(f, find_title(os.path.join(folder, f))) for f in files]
link=file) files.sort(key=lambda t: t[1])
for file, title in files:
docs.add_row(title, link=file)
docs.end_table() docs.end_table()
docs.end_body() docs.end_body()