From d3dca1f3574dc7200ac33e0f198614afe5b04c93 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 26 May 2015 11:15:37 +0100 Subject: [PATCH] Sort keys alphabetically in tables. Sort event types alphabetically in sections. --- templating/internal/sections.py | 2 +- templating/internal/units.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templating/internal/sections.py b/templating/internal/sections.py index 27d792e4..8c3e7393 100644 --- a/templating/internal/sections.py +++ b/templating/internal/sections.py @@ -7,7 +7,7 @@ def _render_section_room_events(env, units): examples = units.get("event-examples") schemas = units.get("event-schemas") sections = [] - for event_name in schemas: + for event_name in sorted(schemas): if not event_name.startswith("m.room"): continue sections.append(template.render( diff --git a/templating/internal/units.py b/templating/internal/units.py index 152ab3c0..793c5222 100644 --- a/templating/internal/units.py +++ b/templating/internal/units.py @@ -23,7 +23,7 @@ def _load_common_event_fields(): "desc": event_info["description"], "rows": [] } - for prop in event_info["properties"]: + for prop in sorted(event_info["properties"]): row = { "key": prop, "type": event_info["properties"][prop]["type"], @@ -72,7 +72,7 @@ def _load_schemas(): tables = [fields] props = obj["properties"] - for key_name in props: + for key_name in sorted(props): value_type = None required = key_name in required_keys desc = props[key_name].get("description", "")