|
|
@ -2,11 +2,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
Renders a single event, given:
|
|
|
|
Renders a single event, given:
|
|
|
|
|
|
|
|
|
|
|
|
* `event_name`: the name we want to display for the event
|
|
|
|
* `event_name`: the name to use for the event
|
|
|
|
* `event_data`: the event specification
|
|
|
|
* `event_data`: the event specification
|
|
|
|
* `desired_example_name` (optional): the exact name of the examples to render.
|
|
|
|
* `desired_example_name` (optional): the exact name of the examples to render.
|
|
|
|
If `desired_example_name` is omitted we render all examples
|
|
|
|
If `desired_example_name` is omitted we render all examples
|
|
|
|
whose names start with the `event_name`.
|
|
|
|
whose names start with the `event_name`.
|
|
|
|
|
|
|
|
* `title` (optional): the title to display. May contain markdown. Defaults to
|
|
|
|
|
|
|
|
`event_name` wrapped in a <code> element
|
|
|
|
|
|
|
|
|
|
|
|
*/}}
|
|
|
|
*/}}
|
|
|
|
|
|
|
|
|
|
|
@ -20,7 +22,7 @@
|
|
|
|
<summary>
|
|
|
|
<summary>
|
|
|
|
|
|
|
|
|
|
|
|
<h1 id="{{ anchorize $event_name }}">
|
|
|
|
<h1 id="{{ anchorize $event_name }}">
|
|
|
|
<code>{{ $event_name }}</code>
|
|
|
|
{{ with .title }}{{ $.title | markdownify }}{{ else }}<code>{{ $event_name }}</code>{{ end }}
|
|
|
|
</h1>
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
<hr/>
|
|
|
@ -72,11 +74,10 @@
|
|
|
|
*/}}
|
|
|
|
*/}}
|
|
|
|
{{ if $desired_example_name }}
|
|
|
|
{{ if $desired_example_name }}
|
|
|
|
{{ if eq $example_name $desired_example_name }}
|
|
|
|
{{ if eq $example_name $desired_example_name }}
|
|
|
|
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" $example "path" "event-schemas/examples") }}
|
|
|
|
{{ partial "events/example" (dict "example" $example)}}
|
|
|
|
```json
|
|
|
|
|
|
|
|
{{ jsonify (dict "indent" " ") $example_content }}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ else if eq $event_name $example_name }}
|
|
|
|
|
|
|
|
{{ partial "events/example" (dict "example" $example)}}
|
|
|
|
{{/*
|
|
|
|
{{/*
|
|
|
|
If `$desired_example_name` is not given, we will include any
|
|
|
|
If `$desired_example_name` is not given, we will include any
|
|
|
|
examples whose first part (before "$") matches the event name
|
|
|
|
examples whose first part (before "$") matches the event name
|
|
|
@ -86,14 +87,7 @@
|
|
|
|
{{ $pieces := split $example_name "$" }}
|
|
|
|
{{ $pieces := split $example_name "$" }}
|
|
|
|
{{ $example_base_name := index $pieces 0 }}
|
|
|
|
{{ $example_base_name := index $pieces 0 }}
|
|
|
|
{{ if eq $event_name $example_base_name }}
|
|
|
|
{{ if eq $event_name $example_base_name }}
|
|
|
|
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" $example "path" "event-schemas/examples") }}
|
|
|
|
{{ partial "events/example" (dict "example" $example)}}
|
|
|
|
{{ $example_json := jsonify (dict "indent" " ") $example_content }}
|
|
|
|
|
|
|
|
{{ $example_json = replace $example_json "\\u003c" "<" }}
|
|
|
|
|
|
|
|
{{ $example_json = replace $example_json "\\u003e" ">" | safeHTML }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
|
|
{{ $example_json }}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|