-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort VoIP events semantically #1967
base: main
Are you sure you want to change the base?
Conversation
Fixes: matrix-org#937 Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
{{ $event_data = partial "json-schema/resolve-refs" (dict "schema" $event_data "path" $path) }} | ||
{{ $event_data := partial "json-schema/resolve-allof" $event_data }} | ||
{{/* Render the events sorted by x-weight or otherwise their event name */}} | ||
{{ range sort $events "event_data.x-weight" "event_name" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? It looks like the only thing you can put as the third argument to sort
is "asc"
or "desc"
: https://gohugo.io/functions/collections/sort/
@@ -41,3 +41,8 @@ same use as `format`, but that applies to the pattern of the property. We also | |||
define custom values for formats with the `mx-` prefix in | |||
`data/custom-formats.yaml`. Those values are recognized in the rendered | |||
specification and link to the definition of the format. | |||
|
|||
## Custom `x-weight` key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless x-weight
is a colloquial identifier, x-sort-weight
may be slightly more self-descriptive?
This introduces an
x-weight
property that can be used to influence the order of events rendered with theevent-group
shortcode and uses it to put the VoIP events into semantic order.Fixes: #937
Pull Request Checklist
Preview: https://pr1967--matrix-spec-previews.netlify.app